Step 3

Step 3: Jump!

We want to be able to click to make the character jump, so go back and edit the script. We need to grab the event block named “When the stage is pressed” from Events (the stage is just another word for the game window).

To make the character jump, we need to change its y velocity – so grab the “Set velocity y 0” block that we placed in the "When created" block from the previous tutorial, and drag the "Sect velocity y 0" block into the "When the stage is pressed" block.

Change the velocity y from 0 to 100.

Click Play to test it out. Does the character jump up?

Since we want the character to move up (not down) we need to set the y velocity to a negative number. Set the velocity y number to -100. You can change it to a higher or lower number if you'd like.

To get the camera following the character, move on to Change my view: Controlling the game camera

results matching ""

    No results matching ""