Skip to main content

Timeline for Smooth jumping in 2D platformers

Current License: CC BY-SA 3.0

9 events
when toggle format what by license comment
Jul 31, 2013 at 11:49 comment added wes this answer + gafferongames.com/game-physics/fix-your-timestep
Jul 31, 2013 at 11:14 comment added Darthman But as I said before nobody will play 2d platformer with 25fps. Any GPU (include CPU internal Intel HD) can draw up to 1000fps in games like that. So this is not problem for me. And it is stupid to load texture while you jumping in game. Anyway if it need to do, you can do it in another thread =)
Jul 31, 2013 at 11:07 comment added Adrian Maire You are right. The problem is when the game load some texture or perform any other operation that produce a lag in the fps, that is, the game run at (eg) 25 fps and in a instant one frame take 1second. In this case your algoritm push the character up like a rocket.
Jul 31, 2013 at 10:35 comment added Darthman In this kind of games you must code your game very bad for getting 1fps :D I mean that it will not give you any difference at 60 or 90 fps. No, really there will be no visible difference. But if there is need to calculate it for 1fps then you must calculate all middle points in one timer iteration. But this is stupid to play that game with 1 fps. I mean nobody will do it.
Jul 31, 2013 at 10:00 comment added Adrian Maire Not, because your equation is a lineal aproximation for a quadratic ecuation: For example with g=1, fps=1 and start speed=5, you will get: 5 9 12 14 15 15 14.., but for fps=2 you get: 10 16 18.. The result trayectory depend of your framerate.That is not so bad, but if the framerate is not constant, you get strange behavior: imagine fps=1 1 20, so your y values will be 5 9 69, that is, a jump of 69 instead of 15.
Jul 31, 2013 at 9:29 comment added Darthman Not exactly. This will work for any framerate if you will take into count delta time bethween frames and will multiply all constants by it.
Jul 31, 2013 at 7:57 comment added Adrian Maire This solution work only if the frame frequency is constant. If for any reason a frame take more than others, the trayectory is strange and not correct.
Jul 31, 2013 at 7:46 review First posts
Jul 31, 2013 at 11:48
Jul 31, 2013 at 7:28 history answered Darthman CC BY-SA 3.0