- Learnt28 min · a plan on paper, three game shapes, the core loop
- Basic25 min · plan your game and build the part you play
- Challenge 1–327 min · your plan, your player, your core loop
- Extrabonus · a rare star worth more
Review — where we got to 5 min
Space Invaders was the last arc. Here is what it built.
- An army from one sprite. Each clone knew its own row and column.
- The army marched together and dropped down at the edge.
- Back rows were worth more than front rows.
- Waves sped up as the army got smaller.
- A win screen and a lose screen ended the game.
Quick-fire
You open Scratch with no plan and start adding things. What happens after twenty minutes?
Reveal the answer
You have lots of half-ideas and no game. A plan tells you what to build first. It also tells you what to leave for later.
Today’s Topic 3 min
- A game plan on one page: goal, player, obstacles, win, lose, score
- A cast list: every sprite, message and variable
- Three game shapes: catcher, dodger and clicker
- The core loop — the part you play — and nothing else
Learning outcome
By the end of this lesson you will be able to:
- Write a one-page plan for a game of your own.
- Choose a game shape and list the sprites it needs.
- Build the part you play, test it, and stop there.
Learnt — plan it, pick a shape, build the core 28 min
1 · A game on one page
Every game answers six questions. Answer them on paper before you open Scratch.
| Question | What it asks | Star Catcher’s answer |
|---|---|---|
| Goal | What is the player trying to do? | Catch as many stars as you can. |
| Player | What do you control? With which keys? | A flying cat. The ← and → keys. |
| Obstacles | What gets in the way? | Rocks fall from the sky too. |
| Win | How do you do well? | A high score. There is no finish line. |
| Lose | How does it end? | Each rock costs a life. Three lives. |
| Score | Which number goes up? | One point for each star. |
Then draw the Stage. Put each sprite where it starts. Draw an arrow for each move.
- Take one sheet of paper.
- Write the six words down the left side.
- Answer each one in one short line.
- Draw a box for the Stage. Draw each sprite where it starts.
- Add an arrow for everything that moves.
2 · The cast list
A plan also lists the parts. Sprites, messages and variables. Write them under your drawing.
SPRITES Cat Flying (the player), Star, Rock MESSAGES none yet — screens come in Lesson 47 VARIABLES score (starts at 0), lives (starts at 3) LATER LIST title screen, sounds, best score, game over screen
3 · Three game shapes
Most small games are one of three shapes. Pick one to start with.
| Shape | You… | The other things… | The score is… |
|---|---|---|---|
| Catcher | move along the bottom | fall from the top | how many you catch |
| Dodger | move all around | fly or bounce about | how long you last |
| Clicker | click with the mouse | appear and move | how many you click |
The catcher
The apples are clones. Each one falls until it reaches the bottom or the bowl. This stack is the heart of every catcher.
when I start as a clone
go to x: (pick random (-200) to (200)) y: (170)
show
repeat until <(y position) < (-170)>
change y by (-5)
if <touching [Bowl v]?> then
change [score v] by (1)
delete this clone
end
end
delete this clone
delete this clone.How to use this: Click the green flag, then click the stage once. Hold ← or → to slide the Bowl under the falling apples.
The dodger
The ladybug follows the mouse. Three balls bounce around. The score is the (timer), so you win by lasting.
when flag clicked
reset timer
forever
go to [mouse-pointer v]
if <touching [Ball v]?> then
broadcast [ouch v]
say (join [You lasted ] (join (round (timer)) [ seconds!]))
stop [this script v]
end
end
ouch.How to use this: Click the green flag, then move the mouse over the stage. The ladybug follows it — keep it away from the balls.
The clicker
The balloons are clones that float up. Each clone has its own click script, so you pop the one you click.
when I start as a clone
switch costume to (pick random (1) to (3))
go to x: (pick random (-200) to (200)) y: (-170)
show
repeat until <(y position) > (170)>
change y by (3)
end
delete this clone
when this sprite clicked
start sound [Pop v]
change [score v] by (1)
delete this clone
How to use this: Click the green flag, then click the balloons on the stage as they float up. Each pop scores a point.
4 · The core loop
The core loop is the part you play, over and over. In Star Catcher it is: move, catch, dodge. Build it in this order, and test after every step.
- The player moves. Test it.
- One star falls. Test it.
- Catching it scores a point. Test it.
- A rock falls and costs a life. Test it.
- Stop. Everything else goes on the later list.
First the cat. Its flag script sets both numbers, then steers for ever.
when flag clicked
set [score v] to (0)
set [lives v] to (3)
go to x: (0) y: (-130)
set rotation style [left-right v]
forever
if <key [right arrow v] pressed?> then
point in direction (90)
change x by (10)
end
if <key [left arrow v] pressed?> then
point in direction (-90)
change x by (-10)
end
end
set rotation style [left-right v] stops the cat flying upside down when it turns left.Then the star. One script makes clones. The other is what each clone does.
when flag clicked
hide
forever
create clone of [myself v]
wait (1) seconds
end
when I start as a clone
go to x: (pick random (-210) to (210)) y: (170)
show
repeat until <(y position) < (-170)>
change y by (-4)
if <touching [Cat Flying v]?> then
change [score v] by (1)
delete this clone
end
end
delete this clone
How to use this: Click the green flag, then click the stage once. Hold ← or → to move the cat. Catch the stars and dodge the rocks.
Basic — plan your game, build the part you play 25 min
Now your own game. Plan first, then build the core loop. No idea yet? Build Star Catcher. It is a good first game.
Step 1 — the plan
- Choose a shape: catcher, dodger or clicker.
- Answer the six questions on paper, one line each.
- Draw the Stage with every sprite and every arrow.
Step 2 — the cast list
- List every sprite, and say which one is the player.
- List every variable, and the number it starts at.
- Start a later list. Put at least three ideas on it.
Step 3 — the player
- Open a new project. Add your backdrop and your player sprite.
- Build its movement. Use the controls from your plan.
- Click the green flag and drive it for ten seconds.
Step 4 — one thing that moves
- Add the sprite that falls, floats or bounces.
- Give it a flag script that hides it and makes clones with
create clone of [myself v]. - Give it a
when I start as a clonescript that moves it. - Watch five of them go by. Check each one disappears at the end.
Step 5 — the score
- Make a
(score)variable, for all sprites. - Set it to 0 on the green flag.
- Change it by 1 when the player catches, dodges or clicks.
- Tick its box so the watcher shows on the Stage.
Step 6 — the danger
In Star Catcher the rock is a copy of the star with three changes. It falls faster. It takes a life instead of giving a point. And the last life stops the game.
- Right-click the star and choose duplicate. Rename the copy Rock.
- Change its costume to the Rocks costume from the library.
- Make a
(lives)variable. Set it to 3 on the flag. - Make the three changes. Then play until you lose.
Step 7 — stop and save
- Play your game for one whole minute.
- Give the project your game’s name. Save it.
- Add anything you wanted to build today to the later list.
If you built Star Catcher, check your Rock against this.
when flag clicked
hide
forever
wait (pick random (2) to (4)) seconds
create clone of [myself v]
end
when I start as a clone
go to x: (pick random (-210) to (210)) y: (170)
show
repeat until <(y position) < (-170)>
change y by (-6)
if <touching [Cat Flying v]?> then
change [lives v] by (-1)
if <(lives) < (1)> then
stop [all v]
end
delete this clone
end
end
delete this clone
Nothing falls at all.
The first sprite is hidden, and only its clones should show. Check the clone script has show in it.
Stars pile up along the bottom.
The last delete this clone is missing, under the repeat until.
One star gives me lots of points.
The clone keeps touching the cat. Put delete this clone inside the if, right after the score.
The cat flies upside down.
Add set rotation style [left-right v] before the forever.
The game stops as soon as I press the flag.
(lives) is still 0 from the last game. Set it to 3 on the green flag.
Your plan on one page
A plan you can build from, for a game that is yours.
- All six questions answered, one short line each.
- The Stage drawn, with every sprite and every arrow.
- A cast list: sprites, messages, variables.
- A later list with at least three ideas on it.
Teacher note — push for nouns
A weak plan is made of adjectives: fun, cool, hard. A strong one is made of nouns you can drag onto the Stage. Ask “which sprite is that?” until every line names one.
Pupils who want a big game should still plan a small core. The big ideas go on the later list, which is a promise, not a refusal.
Your player moves
Only the player, but properly.
- It moves with the controls on your plan, and no others.
- It cannot leave the Stage.
- If it has a front, it faces the way it moves.
- It starts in the same place every time you press the flag.
Teacher note — the start position
The most common miss is the missing go to x: (0) y: (0) at the flag. The player starts wherever the last game left it, and the pupil does not notice until the second run.
Your core loop
The part you play, finished — and nothing more.
- Things arrive by themselves, as clones.
- The player can catch, dodge or click them.
- The score changes the way your plan says.
- There is a way to lose, even a rough one.
- No title screen, no sounds, no menus. Those are on the later list.
Teacher note — the hardest part is stopping
Keen pupils will reach for a title screen before the game works. Point at the later list and ask them to add it there. A finished core loop in week one makes weeks two to four possible.
A pupil whose idea does not fit any of the three shapes is fine. Ask which parts are clones, and what the score counts.
A rare one worth more
One in five of the things you catch is special. It looks different, and it is worth five.
How to use this: Click the green flag, then click the stage once. Hold ← or → to move the cat. The big pink star is worth 5.
Teacher notes — each clone carries its own value
(worth) must be For this sprite only, the same lesson as the Shooting Game’s health. Made for all sprites, the last clone born sets it for everybody.
when I start as a clone
set [worth v] to (1)
if <(pick random (1) to (5)) = (1)> then
set [worth v] to (5)
set [color v] effect to (150)
set size to (110) %
end
go to x: (pick random (-210) to (210)) y: (170)
show
repeat until <(y position) < (-170)>
change y by (-4)
if <touching [Cat Flying v]?> then
change [score v] by (worth)
delete this clone
end
end
delete this clone
Going further: Level 3 keeps many values together in a list, with blocks like add [star] to [falling things v].
Summary 4 min
No new block today. A new habit instead: plan first, build the core, then stop.
- A plan answers six questions and draws the Stage.
- A cast list names every sprite, message and variable.
- Catcher, dodger and clicker share the same clone bones.
- Build the core loop in order, and test after every step.
- Every other idea goes on the later list.
- Game plan
- One page: goal, player, obstacles, win, lose, score.
- Cast list
- Every sprite, message and variable the game needs.
- Core loop
- The part you play, over and over.
- Later list
- Good ideas that wait until the core loop works.
Next lesson: your game has bugs. Every game does. Next time we hunt them — on purpose.