Learning Goals 3 min
By the end of this lesson you will have:
- Built a complete Dance Routine project on Aisyah's cat using repeat (10), motion, and say blocks.
- Clicked the green flag and watched the cat perform a four-beat routine that ends with a friendly "Bagus!" message.
- Extended the routine with personal touches — a different name, more beats, or a second sprite that dances in reverse.
Warm-Up 7 min
This is Arc 8 of 8 — the finale of the Cat Dance Party. Over the last seven lessons you have collected every part: events to start the show, repeat and forever for looping beats, wait for timing, and stop for a clean ending. Today we glue them all into one finished, shareable routine.
Quick-fire puzzle
Daniel Tan built this little stack. He clicked the green flag. What did the cat do?
when flag clicked
repeat (3)
turn cw (30) degrees
wait (0.3) seconds
end
say [Tada!] for (1) seconds
Reveal the answer
The cat turned clockwise 30 degrees, paused, turned another 30, paused, turned another 30, paused — three "beats" of turning, with a 0.3-second pause between each. Total turn: 90 degrees. Then the cat said "Tada!" for a second. That's already a tiny dance — a triple-turn finale.
Today's project just makes the dance longer, more interesting, and more yours.
Project brief — choreograph the cat 15 min
A dance is a sequence of moves done in time. Coders call this a routine. A routine has three parts: set-up (where the dancer starts), beats (the repeating pattern), and a finale (one last move that ends the routine).
Project ingredients (you already know all of these)
| Block | Category | Job in this project |
|---|---|---|
| when ⚑ clicked | Events | Starts the routine when the audience hits the green flag. |
| go to x: (0) y: (0) | Motion | Sets the cat to a known starting position so the dance always begins the same way. |
| point in direction (90) | Motion | Sets the cat to face right so the first beat goes in the expected direction. |
| repeat (10) | Control | Holds the beat pattern. Run the body four times for a four-beat routine. |
| turn cw (90) degrees | Motion | One beat of the dance — turn a quarter of the way around. |
| move (30) steps | Motion | Step forward in the new direction. Combined with the turn, makes the cat trace a small square. |
| wait (0.3) seconds | Control | The pause between beats — without this the dance is too fast to see. |
| say [Bagus!] for (1) seconds | Looks | The finale. "Bagus!" is Malay for "Well done!" — the cat is cheering for itself. |
The four-beat shape
A classic dance shape is the box step: forward, right, back, left — four beats, ending where you started. We'll do this with a turn-then-step pattern inside a repeat (4):
repeat (4)
turn cw (90) degrees
move (30) steps
wait (0.3) seconds
end
The Stage we're working on
Why a routine is a good project
A routine is the simplest example of sequencing — doing things in the right order, the right number of times. You'll meet sequencing in every game, every animation, every story you ever code. Today you build a tiny one, and notice how much character it has even with five or six blocks.
Guided build — Aisyah's Cat dances 15 min
Open Scratch. Click the cat in the Sprite list. We'll rename it, set its starting position, and build the routine together.
Step 1 — Rename the sprite
In the Sprite Properties bar, change the Name field from Sprite1 to Aisyah's Cat. Press Enter.
Step 2 — Drag the hat block
Drag when ⚑ clicked into the Script Area.
Step 3 — Add the set-up blocks
From Motion, drag go to x: (0) y: (0) and snap it under the hat. Then drag point in direction (90) and snap it under that. These two blocks make sure the cat always starts the routine at the centre, facing right — no matter where the cat was when you last clicked stop.
when flag clicked
go to x: (0) y: (0)
point in direction (90)
Step 4 — Drop in the repeat loop
From Control, drag repeat (10). Snap it under the point in direction (90). Change the 10 to 4.
Step 5 — Build the beat (inside the loop's mouth)
Inside the repeat's mouth, snap these three blocks in order:
- turn cw (90) degrees
- move (30) steps
- wait (0.3) seconds
when flag clicked
go to x: (0) y: (0)
point in direction (90)
repeat (4)
turn cw (90) degrees
move (30) steps
wait (0.3) seconds
end
Step 6 — Add the finale
From Looks, drag say [Hello!] for (2) seconds. Snap it below the repeat (not inside it — the say is the finale, it runs once after the loop ends). Edit the text to Bagus! and the time to 1.
Step 7 — Click the green flag
The cat snaps to the centre, faces right, then starts dancing: turn-step-pause, turn-step-pause, turn-step-pause, turn-step-pause. After four beats it lands back near the centre and says "Bagus!" for one second. The routine is done.
What you've built: a complete, self-contained Scratch project. Set-up, four-beat loop, finale. Eight blocks. Three new Control concepts from this cluster (repeat, wait, the c-block shape) — all in one piece of working code.
The full assembled stack (your reference)
when flag clicked
go to x: (0) y: (0)
point in direction (90)
repeat (4)
turn cw (90) degrees
move (30) steps
wait (0.3) seconds
end
say [Bagus!] for (1) seconds
Try It Yourself — extend the routine 12 min
Goal: Make a longer dance. Change the 4 in the repeat to 8, and the turn to 45. The cat now traces an octagon — eight short sides, eight little pauses.
when flag clicked
go to x: (0) y: (0)
point in direction (90)
repeat (8)
turn cw (45) degrees
move (25) steps
wait (0.2) seconds
end
say [Bagus!] for (1) seconds
Think: Eight beats × 45 degrees = 360 — one full circle. Make the steps a bit smaller (25 instead of 30) so the cat doesn't drift off the Stage.
Goal: Personalise the finale. Greet the dancer by name. Change "Bagus!" to your own name or a friend's — try "Bagus, Wei Jie!" or "Selamat, Aisyah!".
when flag clicked
go to x: (0) y: (0)
point in direction (90)
repeat (4)
turn cw (90) degrees
move (30) steps
wait (0.3) seconds
end
say [Bagus, Wei Jie!] for (2) seconds
Think: Text inside the say block is yours to write. British English, Bahasa, your own name — Scratch doesn't mind. Just keep it kind.
Goal: Add a second sprite that dances backwards. Click "Choose a Sprite" (the round blue button below the Stage, bottom right). Pick any sprite — a parrot, a ball, anything. On the new sprite, build a routine that turns counter-clockwise.
when flag clicked
go to x: (0) y: (0)
point in direction (90)
repeat (4)
turn ccw (90) degrees
move (30) steps
wait (0.3) seconds
end
say [Cuba sekali lagi!] for (1) seconds
Think: Both sprites start when the flag is clicked. They run in parallel. Same routine length, opposite turns. If you set their starting positions differently (e.g. one at x = -60, one at x = +60), they trace mirror-image paths. "Cuba sekali lagi!" means "Try it again!".
Mini-Challenge — invent your own beat 5 min
"The routine with your name on it"
Build a routine using at least a repeat (10) loop, at least one turn block, at least one move block, at least one wait, and at least one say [...]. Everything else is your choice — number of beats, turn angle, step size, finale message.
It works if:
- Clicking the green flag once runs the whole routine.
- The cat ends roughly where it started (don't fly off the Stage).
- The finale message is something you wrote yourself — your name, a phrase, a cheer.
Reveal one valid solution
Faridah's routine — six small beats, a tiny step, a Malay finale:
when flag clicked
go to x: (0) y: (0)
point in direction (90)
repeat (6)
turn cw (60) degrees
move (20) steps
wait (0.25) seconds
end
say [Hebat, Faridah!] for (2) seconds
Six beats × 60 degrees = 360 — one circle, just like a hexagon. "Hebat!" is Malay for "Great!". Eight blocks. Yours can look completely different and still pass.
Recap 2 min
Today you built a complete project — the Dance Routine. You combined a set-up (go to + point in direction), a four-beat repeat loop with motion and a pause inside, and a one-line finale. You also gave it personality by renaming the sprite and writing your own message. This is the shape every Scratch project takes: set-up, behaviour, ending.
- Routine
- A sequence of moves done in time. Coders use a loop to repeat the beat pattern.
- Set-up
- The first blocks in a script that put the sprite into a known starting state — position, direction, size. Lets the project run the same way every time.
- Beat
- One pass through the body of the loop. A four-beat dance is a repeat (4) with the beat blocks inside.
- Finale
- The block (or blocks) snapped below the loop. Runs once, after the loop finishes. The natural place for a say-block farewell.
Homework 1 min
The Family Dance. Build a routine for a sprite named after someone in your family (a sibling, a cousin, a friend). The routine should have at least six beats and end with a personalised finale.
- Open Scratch. Rename your cat (or pick a new sprite). Use a real first name from §7 of the Scratch syllabus — Aaina, Imran, Kavitha, Pei Shan, Aaron, Rajesh, Anjali, Yi Xuan, Karthik, or one of your own.
- Build a routine like this — adjust the numbers and the finale text to suit your dancer:
when flag clicked
go to x: (0) y: (0)
point in direction (90)
repeat (6)
turn cw (60) degrees
move (25) steps
wait (0.3) seconds
end
say [Bagus, Imran!] for (2) seconds
Bring back next class:
- A screenshot of your Script Area showing your full routine.
- A short note in your notebook: "Whose dance is this, and why did you pick those numbers?" (No wrong answer — just explain your design choices.)
Heads up for next class: SCR-L01-23 starts a new cluster — Looks blocks. You'll meet the say [Hello!] block in proper detail, learning the difference between the timed version and the bare version (no time argument — it stays on screen).