The Infinite Jumping Game

The game is about bouncing on platforms to get higher and higher…forever. Your score is based on how high you can jump.

Gravity

The first thing to do is to make our player fall down.

We can simulate gravity using a constant acceleration. As you should know from Maths or Physics class, that means we need to keep track of velocity (speed and direction). Let’s add a variable for just that.

Save. You’ll notice the player falls at a constant speed, which isn’t right at all! Let’s change velocity over time, to simulate gravity:

Platforms

Now our player falls down! Let’s add some platforms for him to bounce on. (We won’t do the bouncing part just yet; that’ll have to wait for later.)

Save. Check the platform appears below the player!