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

The flag and clicking the character

Section 4: EventsLesson 4.1 · ⏱ 6 min

An event is something that happens and starts a program: a click on the flag, a click on the character, or a key press. One character can have more than one script, one for each event.

🧩 A script that runs when Robo is clicked
Blocks: when this sprite clicked, say (Ouch!) for (1) seconds, next costume
🖥️ What happens on the stage?
Every time you click Robo, he says Ouch! and switches his costume.

📌 Another example: Robo jumps when you click him

Two scripts: the flag gets Robo ready and asks you to click, and clicking Robo makes him jump.

Blocks: when 🚩 clicked, go to x: (0) y: (0), say (Click me!)
Blocks: when this sprite clicked, say (Hop! 🦘) for (1) seconds, change y by (40), wait (0.3) seconds, change y by (-40)
Before the click
Before the click
After the click
After the click
✍️ Practise
The flag makes Robo welcome you, and clicking Robo makes him spin (turn ↻ 90) and say “I'm dizzy! 😵”.
✍️ Practise here in the lessonor open the lab in a new page ↗

🎯 Challenge yourself

Easy

When you click Robo he says “Thank you 😊”.

👀 Show the solution
Blocks: when this sprite clicked, say (Thank you 😊) for (2) seconds
The result on the stage
The result on the stage
Medium

Every click on Robo makes him 10 bigger. Start with size 100 at the flag. What is his size after 3 clicks?

👀 Show the solution
Blocks: when 🚩 clicked, set size to (100) %
Blocks: when this sprite clicked, change size by (10)
130 after 3 clicks
130 after 3 clicks
Hard

“Catch me” game: every time you click Robo he jumps to a random place and says “Catch me! 😜”.

👀 Show the solution
Blocks: when 🚩 clicked, go to x: (0) y: (0)
Blocks: when this sprite clicked, go to (random position), say (Catch me! 😜) for (1) seconds
Robo got away
Robo got away
Finished the lesson? Mark it so your progress counts.