انتقل للمحتوى
Robo EgyptRobo Egypt
☰ Course contents
Robo Block: home
0. Lab tour1
1. Getting started5
2. Motion5
3. Looks and sound5
4. Events4
5. Loops5
6. Conditions and sensing4
7. Variables and randomness4
8. Project: the “Catch Robo” game3
9. Messages: characters talk to each other4
10. Clones: one character, many copies4
11. My Blocks: make a new block3
12. Operators and time4
13. The pro project: a jumping game4

Jumping

Section 13: The pro project: a jumping gameLesson 13.2 · ⏱ 8 min

A jump = speed upwards. When you press space and Robo is on the ground, we set speed = 16, and gravity brings him back by itself. The “on the ground” condition stops him jumping in mid-air.

Blocks: when 🚩 clicked, go to x: (-120) y: (-120), set (speed) to (0), forever
Robo in the air after pressing space
Robo in the air after pressing space
💡 Tip
Notice the if inside if: the second condition is checked only if the first one is true.

📌 Another example: a jump with sound and movement

When he jumps we switch his costume and play a short note, so you feel that Robo really jumped.

Blocks: when 🚩 clicked, go to x: (-120) y: (-120), set (speed) to (0), forever
He jumped
He jumped
Back on the ground
Back on the ground
✍️ Practise
Make the jump higher if you press space and the up arrow together (speed 22).
✍️ Practise here in the lessonor open the lab in a new page ↗

🎯 Challenge yourself

Easy

Make the right and left arrows move Robo, even while he is in the air.

👀 Show the solution
Blocks: when 🚩 clicked, go to x: (-120) y: (-120), set (speed) to (0), forever
He jumped while moving right
He jumped while moving right
Medium

Count the jumps in a variable jumps, and show it above Robo.

👀 Show the solution
Blocks: when 🚩 clicked, go to x: (-120) y: (-120), set (speed) to (0), set (jumps) to (0), forever
Two jumps
Two jumps
Hard

A wall: if Robo goes past x = 100 he goes back to 100 and says “Wall! 🧱”.

👀 Show the solution
Blocks: when 🚩 clicked, go to x: (-150) y: (-120), set (speed) to (0), forever
He stopped at the wall
He stopped at the wall
Finished the lesson? Mark it so your progress counts.