The Ability of Double Jump- Game Dev Series 79

S.J. Jason Liu
Nerd For Tech
Published in
2 min readJul 14, 2021

--

Quick guide of creating double jump.

Double jump is a kind of common ability in game. As a platformer game, having the ability of double jump would be helpful to players.

In this article, we will create the double jumping function.

The double jumping switch

To do this function, we will need a bool to check is the Player has already double jumped.

Here is the concept of double jump with this bool:
1. This bool should switch to false when Player touched ground.
2. If Player is in air and has not double jumping yet, it should allow Player to jump again.
3. After double jumped, the bool should switch to true to prevent another jumping in air.

Now we can make this concept into code.

Update the Update()

Let’s add the bool to the isGrounded if-statement.

This would make sure Player could not jump again when touched ground.

Now add another if-statement to jump in the air.

With this bool, the Player should be able to jump again in the air.

Oops…

--

--

S.J. Jason Liu
Nerd For Tech

A passionate gamer whose goal is to work in video game development.