Repeat count
Do an action a known number of times.
Curriculum topic
A loop asks a program to repeat useful work without copying the same instruction again and again.
Why it matters
Games constantly redraw motion, check collisions, create waves, and update timers. Robots repeatedly read sensors and correct movement. Loops make that repetition visible, controllable, and easier to change.
Real-world connection
A lighthouse repeats a pattern, a traffic signal cycles through states, and a patrol checks the same route. Repetition becomes useful when the system also knows when to change or stop.
The connection shows where the idea returns; it does not claim every advanced application is taught in this first topic.
Math and logic kernel
Do an action a known number of times.
Continue while the program is running.
Stop when a condition becomes true.
One pass through the repeated instructions.
Small examples
Create repeated hazards with controlled timing.
Repeat costume and position changes.
Repeat movement while checking for an obstacle.
Update a value once per timed interval.
Program connections
Beginner-friendly programming through original games, animations, simulations, and interactive stories.
Commands, sensors, simple electronics, simulations, and physical systems organized around Sense, Decide, Act.
A future bridge from visual programming to Lua, 3D objects, events, and larger game systems.
Common mistakes
The program never reaches the instructions after the loop.
A repeat-until condition can never become true.
Many identical blocks make one change tedious and error-prone.
The result is unreadable because timing was never considered.
Lesson and projects
Build a falling-object defense game with repeated waves, score, timing, and increasingly unreasonable weather.
Open projectDesign a patrol that repeats, senses a changed world, and uses feedback to recover.
Open projectBuild a compact platform game where collision, jumping, safe surfaces, and game state must agree.
Open project