Tech Discussion - Jump mechanics

So I thought I would do a little talk about the game and what has gone into making it. Today I am going to go over Jumping in the game!

So, this seems mundane right? Jumping. Well, there is a lot that goes into making this feel good. I am going to break this down into a couple little things you can do to make your games feel good!

  1. Variable Jumping

No one wants a stale jump for the player. Jumping is usually achieved in code by setting the player's Y velocity to a max jump velocity.  Doing this, and just this when the button is pressed, creates a stale parabola that is the same for every jump no matter the press the player does.

One way to make it feel better is Variable Jumping. This involves applying a little bit of extra gravity on the player when the jump button is released and they are still in air. The resulting effect is like this:


Apply some squish and stretch for added emphasis. :)

2. Coyote time

So this one is one that if done right, the player won't even notice! However, they will if it is absent. What Coyote time is, is a few frames of leeway after leaving a platform where the player can still make a jump. This accounts for any amount of input lag, player error, etc. 

As you can kinda see,  the player is off of the platform and can still make the jump.

3. Corner Correction

So, this one would be super hard to show, but it is another one that player will notice if it isn't there. Corner correction is super important for tight controls. The basic theory here is: When approaching a ledge, we check to see if there is a pixel up or down on the ledge and if there is, we put the player there. This accounts for minor amount of player error and it makes the game feel fairer.

There is more that goes into it, but those are the big ones! I will explain in more detail if people are interested!

Until next time,


Leave a comment

Log in with to leave a comment.