Page 1 of 3

information on creating a platform game

Posted: Tue Jan 11, 2011 1:12 pm
by sp2011
Hello!

Now that I have built a space invaders clone ( http://love2d.org/forums/viewtopic.php?f=5&t=2304 ), next I would like to build a platform game.

Are there any tutorials around (forums or internet) or projects posted in the forums that can help me with that?

Basic information that I want to know, is 1) how to move the scenery from right to left and have collision detection with the various elements, e.g. obstacles, enemies of the scrolling scene against the player's sprite. 2) how to describe this scrolling scenery in lua, using tables, graphics and whatnot.



Thanks!

Re: information on creating a platform game

Posted: Tue Jan 11, 2011 9:19 pm
by Jasoco
We're working on it. It's not that easy. Also, stay away from Box2D for character movement and interaction. It does not work. Box2D physics do not equal Mario or Sonic or Cave Story or even Super Meat Boy physics.

Work on something else for now. Or try your hand.

The problem I ran into is that if the computer slows down, dt does not work as well for making sure you move correctly. If I'm jumping and my computer has a hiccup, i.e. when my desktop picture fades from one to another, I end up jumping too short. DeltaTime is supposed to avoid this, but for some reason it does not. Don't know why.

Re: information on creating a platform game

Posted: Wed Jan 12, 2011 10:47 am
by BlackBulletIV
Jasoco wrote:The problem I ran into is that if the computer slows down, dt does not work as well for making sure you move correctly. If I'm jumping and my computer has a hiccup, i.e. when my desktop picture fades from one to another, I end up jumping too short. DeltaTime is supposed to avoid this, but for some reason it does not. Don't know why.
Hmmm, yeah, another problem I found with dt is if the framerate gets really low (like 1-3 FPS or something) then the physics system goes wild. For example boxes with run over each other, structures will collapse, and all manner of strange happenings.

Re: information on creating a platform game

Posted: Wed Jan 12, 2011 11:25 am
by Chief
BlackBulletIV wrote:Hmmm, yeah, another problem I found with dt is if the framerate gets really low (like 1-3 FPS or something) then the physics system goes wild. For example boxes with run over each other, structures will collapse, and all manner of strange happenings.
I have experienced that too. I was making a game where this ball would fall down a track, but when i i tried it on my old school laptop - which sometimes had 1-3 FPS - the ball would spasm and fly like a squirrel on coffee. (worked fine on my desktop)

Re: information on creating a platform game

Posted: Wed Jan 12, 2011 2:44 pm
by TechnoCat
BlackBulletIV wrote:Hmmm, yeah, another problem I found with dt is if the framerate gets really low (like 1-3 FPS or something) then the physics system goes wild. For example boxes with run over each other, structures will collapse, and all manner of strange happenings.
Ceiling dt to a maximum (relatively small) number. The game will technically slow down time, but it will keep a minimum precision.

Re: information on creating a platform game

Posted: Wed Jan 12, 2011 8:56 pm
by BlackBulletIV
Ah so by using that method you would trade physical weirdness for slow motion. That would be the best solution I guess.

Re: information on creating a platform game

Posted: Thu Jan 13, 2011 12:19 pm
by FinalSin
I think Flixel does it by limiting the frame rate regardless to a certain FPS. I have no idea how feasible that is here.

Unfortunately I came here to ask about doing a platformer too. I guess that'll have to go in a different library, alas.

Re: information on creating a platform game

Posted: Thu Jan 13, 2011 3:20 pm
by thelinx
FinalSin wrote:I think Flixel does it by limiting the frame rate regardless to a certain FPS. I have no idea how feasible that is here.

Unfortunately I came here to ask about doing a platformer too. I guess that'll have to go in a different library, alas.
Why?

Re: information on creating a platform game

Posted: Thu Jan 13, 2011 3:48 pm
by TechnoCat
FinalSin wrote:Unfortunately I came here to ask about doing a platformer too. I guess that'll have to go in a different library, alas.
Well, I feel LOVE is perfectly able to do a platform. But, if you feel LOVE is too technical, you should check out E02.

Re: information on creating a platform game

Posted: Thu Jan 13, 2011 8:19 pm
by BlackBulletIV
FinalSin wrote:I think Flixel does it by limiting the frame rate regardless to a certain FPS.
I've never used Flixel, but I know FlashPunk (a similar library) has the option of either fixed frame rate (what you just described) or a variable capped frame rate, meaning that the frame rate can vary (therefore you use delta time) but it is capped to a certain frame rate (by default 60).