Platform jumper

Here is an example of a side scrolling game where the hero jumps over endless platforms.

This game is not using a tilemap, so you can make the game as big as you like. You might also want to have the player shoot projectiles at enemies, perhaps jump over other obstacles.

You can also play the game here:
and also fork the repository:

Have fun customizing the game. Please let me know if you have any questions on the game mechanics, and ways of improving it.


What math do you use for collisions?

I don’t use any math.

At the start of the game a place sprites until the width of the screen and place the player on top of one. I then set the ay of the player to a positive value so that it falls. In the method ‘checkPlayer’ I check if the player is overlapping one of the ‘platform’ sprites, and if so, move the player up one pixel at time until the bottom of the player is less the the platform it hits. At this point, I set the vy & ay to zero so the player is no longer falling. When the player jumps, I see ay again so the player eventually falls again.


This maybe by design, I’m not sure. I noticed you can wait long enough to let the player begin to fall between two platforms and when it seems it should irrevocably fall down, you can jump up “mid air”.