Ψ§Ω†ΨͺΩ‚Ω„ Ω„Ω„Ω…Ψ­ΨͺΩˆΩ‰
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

πŸ› οΈ Section project: the countdown and the rocket

Section 12: Operators and timeLesson 12.3 · ⏱ 10 min
🎯 Project goal
A variable count starts at 5; Robo says it and takes one away every second until zero, then β€œGo!” and he flies off.
Blocks: when 🚩 clicked, go to x: (0) y: (-120), set (count) to (5), repeat until <(count = 0)>, say (Go! πŸš€), repeat (25)
The countdown
The countdown
count = 0: Robo took off upwards
count = 0: Robo took off upwards
πŸ–₯️ What happens on the stage?
At the end count = 0 (we tested it in Robo Block).

πŸ“Œ Another example: a rocket with fuel

The variable fuel starts at 5, and every round the rocket goes up 40 and burns one unit of fuel, until the fuel is 0.

Blocks: when 🚩 clicked, go to x: (0) y: (-120), set (fuel) to (5), repeat until <(fuel = 0)>, say (Out of fuel! β›½)
Going up
Going up
Out of fuel
Out of fuel
✍️ Practise
Make your own rocket: choose where the countdown starts and how it takes off.
✍️ Practise here in the lessonor open the lab in a new page β†—

🎯 Challenge yourself

Easy

A fast countdown from 10 (0.2 seconds for each number), then β€œGo! πŸš€β€.

πŸ‘€ Show the solution
Blocks: when 🚩 clicked, go to x: (0) y: (-120), set (count) to (10), repeat until <(count = 0)>, say (Go! πŸš€)
The result on the stage
The result on the stage
Medium

A rocket that speeds up: the variable speed starts at 1, and every round Robo goes up by speed, then speed grows by one.

πŸ‘€ Show the solution
Blocks: when 🚩 clicked, go to x: (0) y: (-120), set (speed) to (1), repeat (15)
Up faster and faster
Up faster and faster
Hard

With every number of the countdown from 5, Robo gets 10 smaller. What is his size at the end?

πŸ‘€ Show the solution
Blocks: when 🚩 clicked, go to x: (0) y: (-40), set size to (100) %, set (count) to (5), repeat until <(count = 0)>, say (I'm small now!)
The size is 50
The size is 50
Finished the lesson? Mark it so your progress counts.