Learning Goals 3 min
By the end of this lesson you will be able to:
- Find
wait (1) secondsin the Control category and snap it between two actions. - Use decimal waits such as
0.5to change how a sequence feels. - Explain why a script with no waits is often impossible to watch.
Warm-Up 7 min
Your cat answers three different cues now. But every script it runs is over the instant it starts — and a dance that finishes before anyone sees it is not much of a dance.
Quick-fire puzzle
Wei Jie built this and clicked the flag. He insists the cat only said one thing. What did he actually see?
when flag clicked
say [Ready]
say [Steady]
say [Go!]
Reveal the answer
He saw “Go!” and nothing else. All three ran, but a plain say [Hello!] block does not hold the script up at all, so each bubble was replaced before the screen could redraw.
Two of his three lines really did happen. They were simply never visible — which is exactly the problem today’s block solves.
New Concept — pausing on purpose 15 min
Music is not just notes; it is notes with silence between them. Take the gaps out of a song and you are left with noise. Scripts are the same — the pauses are part of the performance.
The new block
| Block | Category | What it does |
|---|---|---|
wait (1) seconds | Control | Holds the script exactly where it is for that many seconds, then carries on with the next block. |
A new colour in your toolbox
This is your first proper Control block — the soft orange category you spotted back in Lesson 3. Control blocks do not move sprites or change how they look. They manage when things happen, which turns out to matter just as much.
You have borrowed this block twice already, in Lessons 4 and 5. Today it gets taught properly, and everything after this in the arc depends on it.
when flag clicked
say [Ready] for (1) seconds
wait (1) seconds
say [Steady] for (1) seconds
wait (1) seconds
say [Go!] for (1) seconds
Waiting is not stopping
A wait pauses this script and nothing else. Other scripts on the same sprite carry on quite happily, and so do other sprites. That matters more than it sounds: a cat can be waiting in one script while answering a key press in another.
Fractions matter
The number does not have to be whole. 0.5 is half a second, 0.2 is a snappy beat, 3 is a dramatic pause. Dance routines live in the small numbers; storytelling lives in the larger ones.
Why it matters
Everything from here on needs timing. A dance is moves with gaps; a story is lines with pauses; a game is events with breathing space. Without waits, all three collapse into a single frame.
Worked Example — a paced entrance 15 min
We build the cat’s entrance twice: once with no timing at all, then again with it, so the difference is impossible to miss.
Step 1 — Build it with no timing at all
Reset the cat to x = -170, then build the stack below and run it.
when flag clicked
say [Ready]
move (90) steps
say [Steady]
move (90) steps
say [Go!]
move (90) steps
Step 2 — Watch it fail
The cat appears at the far side saying “Go!”. Everything else happened invisibly. This is worth doing rather than just reading about — the effect is startling.
Step 3 — Open the Control category
Click the soft orange dot in the Blocks Panel. wait (1) seconds sits near the top.
Step 4 — Add timing between the beats
Slide a wait in after each move, and swap the plain say blocks for the timed kind so each line holds on screen.
when flag clicked
say [Ready] for (1) seconds
move (90) steps
wait (1) seconds
say [Steady] for (1) seconds
move (90) steps
wait (1) seconds
say [Go!] for (1) seconds
Step 5 — Run it again
The cat announces, steps, pauses, announces, steps, pauses, then finishes. Same actions as Step 1, completely different experience.
Step 6 — Change the tempo
Set both waits to 0.3 and run it: the entrance turns brisk and urgent. Set them to 2 and it becomes solemn. You are directing now, not just coding.
Step 7 — Prove that waits are local
While the script is mid-pause, press one of your arrow keys from Lesson 16. The cat responds instantly, because that is a different script and the wait never touched it.
What changed: your scripts have stopped being instant. That is the difference between a list of instructions and a performance.
The full assembled stack (your reference)
when flag clicked
say [Ready] for (1) seconds
move (90) steps
wait (1) seconds
say [Steady] for (1) seconds
move (90) steps
wait (1) seconds
say [Go!] for (1) seconds
Try It Yourself — three small builds 12 min
Goal: Make the cat take three separate steps that you can actually count, a second apart.
when flag clicked
move (40) steps
wait (1) seconds
move (40) steps
wait (1) seconds
move (40) steps
Think: take the two waits out and the cat covers the same 120 pixels in one invisible jump. The distance never changed — only whether you could see it happen.
Goal: Give the cat a four-beat dance step using half-second waits, so it feels like music rather than marching.
when flag clicked
turn cw (15) degrees
wait (0.5) seconds
turn ccw (15) degrees
wait (0.5) seconds
turn cw (15) degrees
wait (0.5) seconds
turn ccw (15) degrees
Think: the cat ends exactly where it began, because the turns cancel out. What is left is pure rhythm — which is what a dance step really is.
Mini-mission: the traffic light. Build a working traffic light that holds each colour for a believable length of time, then sends the cat off when it turns green.
It works if: the three colours are announced in the right order, amber is noticeably briefer than red, and the cat does not move until green. Stay within 8 blocks.
Think: real amber lights are short on purpose. Which numbers make yours feel believable — and does your cat set off a fraction too early?
Mini-Challenge — the metronome cat 5 min
“Wei Jie keeps the beat”
Build a script where the cat crosses the stage in a perfectly steady rhythm — steady enough that a friend can clap along without ever losing the beat.
It works if:
- One flag click runs the whole sequence.
- The cat moves at least four times, in evenly sized steps.
- The gaps between steps are all identical, so a partner can clap along.
- The whole thing lasts long enough to watch without dragging.
Reveal one valid solution (teacher)
when flag clicked
move (90) steps
wait (0.5) seconds
move (90) steps
wait (0.5) seconds
move (90) steps
wait (0.5) seconds
move (90) steps
Eight blocks exactly. The interesting discussion is what happens if a wait is left on the end — the script finishes with a silent half-second that nobody notices now, but which matters enormously once loops arrive next lesson.
Recap 2 min
Your first proper Control block. wait (1) seconds holds a script exactly where it is for as long as you say, then lets it carry on. Decimals work, so half-seconds and fifths of a second are all available. And a wait only pauses its own script — everything else in the project keeps running.
- wait (block)
- A Control block that pauses its script for a set number of seconds. Decimals allowed.
- Control
- The soft orange category. These blocks manage when things happen rather than what happens.
- Rhythm
- The pattern of gaps between actions. Even gaps feel steady; uneven ones feel like a dance.
- Local pause
- A wait affects only the script it sits in. Other scripts carry on regardless.
Homework 1 min
The countdown. Build a countdown that ends with the cat setting off across the stage.
- Build a script that counts down from three, one number per second.
- After “Go!”, send the cat across the stage.
- Run it and time it with a clock — it should take about as long as you planned.
- Screenshot your Script Area.
when flag clicked
say [3] for (1) seconds
say [2] for (1) seconds
say [1] for (1) seconds
say [Go!] for (1) seconds
move (200) steps
Bring back next class:
- A screenshot of your countdown script.
- Your answer to: “This version has no wait blocks at all, yet it still takes four seconds. Where is the waiting happening?”
Heads up for next class: SCR-L01-19 introduces repeat (10). You will never have to copy the same four blocks over and over again.