There are two loops you'll use constantly, and choosing between them is easy once you know the question to ask.
repeat 10 runs the blocks inside exactly ten times, then moves on to whatever comes next.forever runs them over and over until the program stops. Nothing after a forever loop ever runs.The question to ask: does this have a natural end? Blink three times has an end — use repeat. Watch for the player touching an enemy never ends while the game is on — use forever.
This catches everyone once.
forever
move 5 steps
say "Finished!"
The sprite moves forever. "Finished!" never appears — the loop never ends, so the script never reaches it.
If you need something to happen after repetition, either use a counted repeat, or put the thing you need inside the forever loop with a condition around it.
5 more parts in this lesson
Walkthroughs, code labs, mini-games and the checkpoint quiz unlock when you buy the course.