انتقل للمحتوى
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

Questions inside the loop

Section 6: Conditions and sensingLesson 6.2 · ⏱ 7 min

We can ask about the keys inside forever instead of using event blocks. That makes the movement smoother, and you can press two keys together.

Blocks: when 🚩 clicked, forever
🖥️ What happens on the stage?
As long as you hold the right arrow, Robo moves smoothly to the right, and the same with the left arrow.

📌 Another example: the spinner

As long as space is held down, Robo turns 10 degrees on every round of forever. Let go and he stops.

Blocks: when 🚩 clicked, point in direction (90), forever
He spun while you held it
He spun while you held it
✍️ Practise
Add the up and down arrows, then make the key a grow Robo as long as it is held.
✍️ Practise here in the lessonor open the lab in a new page ↗

🎯 Challenge yourself

Easy

As long as space is held, Robo switches his costume (as if he is dancing).

👀 Show the solution
Blocks: when 🚩 clicked, forever
The result on the stage
The result on the stage
Medium

The right arrow moves Robo right, and the up arrow moves him up. Hold both arrows together: which way does he go?

👀 Show the solution
Blocks: when 🚩 clicked, go to x: (0) y: (0), forever
Diagonally, up and to the right
Diagonally, up and to the right
Hard

Turbo speed: the right arrow moves Robo 3, but if space is held too he moves 15 and says “Turbo! 🚀”. (if inside if)

👀 Show the solution
Blocks: when 🚩 clicked, go to x: (-200) y: (0), forever
With space: turbo
With space: turbo
Finished the lesson? Mark it so your progress counts.