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.

🖥️ 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.




✍️ Practise
The flag makes Robo welcome you, and clicking Robo makes him spin (turn ↻ 90) and say “I'm dizzy! 😵”.
✍️ Practise here in the lesson✖ Close the labor open the lab in a new page ↗
🎯 Challenge yourself
Easy
When you click Robo he says “Thank you 😊”.
👀 Show the solution🙈 Hide the solution


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🙈 Hide the solution



Hard
“Catch me” game: every time you click Robo he jumps to a random place and says “Catch me! 😜”.
👀 Show the solution🙈 Hide the solution




