Page 7 of 8

Re: Tutorial requests and ideas

Posted: Sun Apr 13, 2008 11:48 pm
by rude
Hehe, peeked at the code. Looks like you've built a nice little framework.

So about input.context, do you do something like this somewhere?

Code: Select all

function keypressed(key)
   local fn = ic[key]
   if fn then fn() else game_keypressed(key) end
end
I failed at finding this redirection in your code (didn't look very hard ;) ).

Re: Tutorial requests and ideas

Posted: Wed Apr 16, 2008 8:47 am
by aes
rude wrote:Hehe, peeked at the code. Looks like you've built a nice little framework.

So about input.context, do you do something like this somewhere?
(code ...)
rude wrote: I failed at finding this redirection in your code (didn't look very hard ;) ).
(So close... keep reading) Like this!

Code: Select all

  local dispatch
  dispatch = function(...)
    local t = table.merge(...)
    t[1](unpack(t, 2))
    --pcall(t[1], unpack(t, 2)) -- why doesn't this work?
    --pcall(unpack(t))          -- or this? (should but doesn't?)
  end
Same thing except moo:frob(a,b,c) can be called from it by a packing it, lisp style. (the function itself is "argument zero")

Code: Select all

ic = input.context:new{
  keydown={
    [love.key_a] = { frob, moo, a, b, c },
  },
  chain_mode = 'chain',
}
input.push(ic)
This would add a temporary callback for 'a', overriding the previous. As the menu demo shows, takes some clever to define things in the right order, but once you do, it works out nicely. I should also point out that the table.merge (in util.lua) concatenates the (key, x,y, button, whatever) to the call, so the fun/method actually called is something like moo:frob(a,b,c,key). But in Lua this is mostly safe, since extraneous parameters are ignored. (I mention it because it's not ok if there's another parameter you would have wanted to send as nil, but an explicit nil should work.)

Re: Tutorial requests and ideas

Posted: Thu Apr 17, 2008 4:06 am
by mike
I am going to interrupt this conversation to bring you:
Mike's Wonderful Isometric Graphics Tutorial

Now, before you make any snide comments about the shitty graphics (I am looking at you, rude), keep in mind that this is not supposed to look awesome, just good enough to get an idea across. I could not find the wonderful tiles I made for the horrible Dirt Manager game I (never actually) made so I whipped up some simple ones in the photoshop.

For the interested: the screenshot.

Re: Tutorial requests and ideas

Posted: Fri Apr 18, 2008 2:35 am
by Merkoth
A really nice one mike :)

Re: Tutorial requests and ideas

Posted: Mon Jun 23, 2008 12:49 am
by qubodup
I think Tutorial 7: Drawing Order Based on Position should be fixed. I only get a black screen with current löve.

Re: Tutorial requests and ideas

Posted: Mon Jun 23, 2008 12:29 pm
by rude
Thanks! Seems like you found another bug in LOVE. For some reason, the default "color mode" seems to be love.color_modulate. If the current color is (0, 0, 0), then everything will be rendered in black, and that is what happens in that tutorial.

Calling love.graphics.setColorMode(love.color_normal) in load() fixes the problem (or set the current color to pure white). Going to wait a few weeks with a bugfix release, in case more bugs appear.

8-)

Re: Tutorial requests and ideas

Posted: Thu Jun 26, 2008 3:46 pm
by qubodup
Say, what is the music from the audio tutorial? the non-chip-like one.

Re: Tutorial requests and ideas

Posted: Thu Jun 26, 2008 8:05 pm
by rude
Oh, that. That's just a quick loop mike, fleg and me made a couple of years ago. There's nothing more ... that is the whole song. :D

Re: Tutorial requests and ideas

Posted: Thu Jun 26, 2008 10:26 pm
by qubodup
rude wrote:Oh, that. That's just a quick loop mike, fleg and me made a couple of years ago. There's nothing more ... that is the whole song. :D
It is hilarious! Please make a proper release sometime (licensed under a zlib license with "software" replaced by "music" or some thing like that :) )

Is there a form of this track that is the preferred form for making modifications? Would you release it?

End Annoy

Re: Tutorial requests and ideas

Posted: Thu Jun 26, 2008 10:30 pm
by rude
It can be released and licensed, but we need to find the ANCIENT source and create an MP3 with higher bitrate ... the one in the demo is horrible I believe.

I'll ask fleg, I think he might have the original files.

8-)