This will technically be the player's speed, but it will in fact be moving everything except the player
I will be adding this code to my Stage, but it doesn't really matter where the code is placed
Y Speed will control the player moving up and down, while Gravity will always be trying to pull the player back down to the Ground
Hint: Look at Step 2 to see how we created a new variable for Speed
This will make the player fall with gravity and stop when it hits the ground
The player will also be doing a front flip!
The lesson is now complete!
In the next part, we will making the triangle hazards move and cause the game to end.
Created 6 months ago
Teach coding to your students with MVCode Teach
MVCode offers an integrated product designed to teach coding to students.
Learn more about MVCode Teach