Double Jump

mechanics space polish and systems

How to implement this Pattern in MakeCode

Create a “canDouble Jump” variable

We need to create a variable called canDoubleJump. Now add a block at the start of our game and set it to true to start with.

Double Jump 2

Create a Logic block to test if player can jump or not

Then you need to use blue logic blocks to check to only jump if

Double Jump 3

Once the player has used up their double jump ability, you set the canDoubleJump variable to false. This stops the player from being able to jump more than twice.

Reset canDoubleJump variable

Then we must create to code to reset the canDoubleJump variable when you touch the ground again. To do this create a on game update loop and put a logic block in there which will turn canDoubleJump true when you are touching the ground again.

Double Jump 1

Test your Changes and Next Steps

Test your game to check that your changes have the desired behaviour and no side effects. To check that you are making the most of this pattern you can ask yourself the following questions:

This Game Pattern is one of many allowing you to make improvements to your platform game and to learn coding and wider computing concepts. Find more on the Game Pattern page.