Repeat forever
Section 5: LoopsLesson 5.3 · ⏱ 6 min
forever repeats the blocks inside it with no end, until you click the stop button. We use it in games because a game runs all the time.

🖥️ What happens on the stage?
Robo walks all the time, and every time he touches the edge of the stage he bounces back.
📌 Note
You can't snap a block under forever, because it never ends.
📌 Another example: the guard
Robo guards the road: he goes right, then comes back left, without stopping until you click 🛑.




✍️ Practise
Add turn ↻ 5 inside forever with move and bounce, and watch how Robo moves.
✍️ Practise here in the lesson✖ Close the labor open the lab in a new page ↗
🎯 Challenge yourself
Easy
Make Robo dance without stopping: he switches his costume every 0.3 seconds.
👀 Show the solution🙈 Hide the solution


Medium
Make Robo beat like a heart: he grows by 20, then shrinks by 20, without stopping.
👀 Show the solution🙈 Hide the solution


Hard
Robo walks at a slant (45) and bounces off the edges, with the pen down and its colour changing at every step.
👀 Show the solution🙈 Hide the solution



