Learning Goals 3 min
By the end of this lesson you will be able to:
- Assemble a complete game from a title, a scoring loop and an ending.
- Test a project the way a stranger would, and fix what that finds.
- Save, name and share a finished Scratch project with instructions.
Warm-Up 7 min
Everything in today’s game already exists in your project. What is missing is the frame around it — the part that tells a player what to do and when they are finished.
Quick-fire puzzle
Hand your project to the person next to you without saying anything. Watch what they do first.
What usually happens
They click things at random until something moves. They do not know they are meant to click the roti, or what the number in the corner is for, or when they have won.
Everything they are missing is a thing you know and have not written down anywhere. That is what a title screen is for.
New Concept — the shape of a finished game 15 min
A finished game has three parts, and only one of them is the game. You have spent three lessons on the middle. Today you build the two ends, which together take about ten minutes.
The rule that ties it together
The flag script must put the project into exactly the same state every time, no matter what the previous run left behind. That covers the score, the roti’s position, its size, whether it is showing, and which readouts are on screen.
You have met this idea in every arc of this level. It is the last time it will be new, because from now on you will simply do it.
Blocks you will use today
| Block | Category | Its job today |
|---|---|---|
when flag clicked | Events | Starts the title and the reset. |
set [score v] to (0) | Variables | Clears the previous run. |
show variable [score v] | Variables | Puts the readout up when play starts. |
when this sprite clicked | Events | The catch trigger, on the roti. |
go to [random position v] | Motion | The roti gets away. |
when [space v] key pressed | Events | Ends the game and shows the result. |
stop [other scripts in sprite v] | Control | Makes the ending actually stop things. |
Why it matters
Finishing is a skill of its own, and it is rarer than starting. Plenty of people can build a catch loop. Far fewer wrap it up so a stranger can pick it up and play.
Worked Example — finish the game 15 min
Open your project from last lesson. You are adding the two ends and then testing hard.
Step 1 — The title, on the cat
Select the cat. This script tells the player what to do before anything else happens.
when flag clicked
hide variable [score v]
say [Click the roti! Space to stop.] for (3) seconds
set [score v] to (0)
show variable [score v]
say [Go!] for (1) seconds
Step 2 — The reset, on the roti
Select the roti. The flag has to undo everything a previous game did to it.
when flag clicked
hide
set size to (100) %
go to x: (0) y: (0)
wait (4) seconds
show
Step 3 — The catch loop, unchanged
This is last lesson’s script. It does not need touching, which is a good sign.
when this sprite clicked
start sound [Pop v]
change [score v] by (1)
change size by (20)
wait (0.1) seconds
change size by (-20)
go to [random position v]
Step 4 — The ending, on the roti
Space ends the round. The roti has to disappear, or the player carries on scoring during their own victory.
when [space v] key pressed
stop [other scripts in sprite v]
hide
Step 5 — The result, on the cat
The cat announces the score. The variable reporter goes straight into the say block.
when [space v] key pressed
say (score) for (3) seconds
say [Green flag to play again!] for (3) seconds
Step 6 — Test it like a stranger
Run the whole thing three times in a row without stopping to fix anything. Write down every single thing that looks wrong, then fix them afterwards.
Testing and fixing at the same time is how bugs get missed. Separate the two and you find more.
Step 7 — Name it and save it
Give the project a real title — Catch the Roti Canai — and fill in the instructions box: what to click, how to score, how to stop. Then save.
What changed: you no longer have a project you have to explain. You have a game someone can play without you in the room.
The full script list (your reference)
| Sprite | Hat | Job |
|---|---|---|
| Cat | when flag clicked | Title, instructions, reset the score. |
| Cat | when [space v] key pressed | Announce the score, invite another go. |
| Roti | when flag clicked | Reset size, position and visibility. |
| Roti | when this sprite clicked | The catch loop. |
| Roti | when [space v] key pressed | Stop and hide. |
Five scripts across two sprites. Every one of them is under eight blocks.
Try It Yourself — three small builds 12 min
Goal: Make the cat react while the player is scoring, not only at the end.
when [space v] key pressed
say [Wah, so many roti!] for (2) seconds
say (score) for (3) seconds
Think: a game that comments on how you did feels made by a person. That costs one extra block.
Goal: Make the game get harder the longer it goes on.
when this sprite clicked
change [score v] by (1)
change size by (-4)
go to [random position v]
Think: at −4 a size the roti is unclickable somewhere around twenty catches. Is that too soon, or exactly right?
Mini-mission: the second player. Give the game a two-round structure — round one is the plain roti, round two adds a burnt one that costs points.
It works if: the burnt roti is hidden during round one, appears when the cat announces round two, costs points when clicked, and is hidden again by the flag. Keep each stack under 8 blocks.
Think: which sprite should decide when round two starts — and how does the burnt roti find out?
Mini-Challenge — the stranger test 5 min
“Hand it over and say nothing”
Swap seats with someone who has not seen your game. Watch them play without helping, without explaining and without touching the mouse. Write down what confuses them.
It works if:
- You watch someone play without saying a word.
- You write down at least two things that confused them.
- You fix both, then have a second person try it.
- The second person needs less help than the first.
Recap 2 min
A finished game is a start, a middle and an end, and only the middle is the game. The flag script has to return the whole project to a known state, whatever the last run left behind — you have now met that rule in six arcs. An ending has to stop things as well as announce them, or the player keeps scoring after they have won. And handing your project to a stranger finds more bugs in three minutes than an hour of testing it yourself.
- Ship it
- Finishing and releasing a project rather than leaving it nearly done.
- Reset script
- The flag script that returns every sprite and variable to its starting state.
- Stranger test
- Watching someone play with no help, to find what your game fails to explain.
- Instructions
- The notes on a shared project telling a player what to do.
Homework 1 min
One more player. Your game has been tested by a classmate. Now test it on someone who has never used Scratch.
- Ask a family member to play your shared game with no explanation from you.
- Watch what they do in the first ten seconds and write it down.
- Note down every question they ask you.
- Make one change to the game that would have answered their first question.
Bring back next class:
- Your list of their questions, and the one change you made.
- Your answer to: “What did you have to explain out loud, and where should that have been written into the game instead?”
Heads up for next class: SCR-L01-44 is a build lesson — Cat Chase, a game where the target does not wait to be clicked.