Step 9: Double Jump and Fall Speed Variables

Goal:


Now we need to make variables to code the block’s double jump and the speed at which the block will fall.

For our double jump variable, it can only take the value True or False. This allows our player sprite to decide if it can jump again or not.

For the fall speed variable, it will be used to set how fast the player will fall or to not fall at all if they are touching the ground.

Steps:

  1. Select Variables.
  2. Click the Make a Variable.
  3. In the window that appears type “double_jump”.
  4. Click the Make a Variable again.
  5. In the window that appears type “fall_speed”.
  6. Click the check box to uncheck the variables.

Code: