Tutorial requests and ideas

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
rude
Administrator
Posts: 1051
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Tutorial requests and ideas

Post 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 ;) ).
User avatar
aes
Prole
Posts: 13
Joined: Sat Mar 29, 2008 2:24 am

Re: Tutorial requests and ideas

Post 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.)
User avatar
mike
Administrator
Posts: 364
Joined: Mon Feb 04, 2008 5:24 pm

Re: Tutorial requests and ideas

Post 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.
Now posting IN STEREO (where available)
User avatar
Merkoth
Party member
Posts: 186
Joined: Mon Feb 04, 2008 11:43 pm
Location: Buenos Aires, Argentina

Re: Tutorial requests and ideas

Post by Merkoth »

A really nice one mike :)
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: Tutorial requests and ideas

Post by qubodup »

I think Tutorial 7: Drawing Order Based on Position should be fixed. I only get a black screen with current löve.
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
rude
Administrator
Posts: 1051
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Tutorial requests and ideas

Post 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-)
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: Tutorial requests and ideas

Post by qubodup »

Say, what is the music from the audio tutorial? the non-chip-like one.
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
rude
Administrator
Posts: 1051
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Tutorial requests and ideas

Post 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
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: Tutorial requests and ideas

Post 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
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
User avatar
rude
Administrator
Posts: 1051
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Tutorial requests and ideas

Post 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-)
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 10 guests