Year 7 · Summer 1
Scratch II: Subroutines and lists · Lesson 5 of 5
Build and playtest the game
ProjectTopic 11 Algorithms
Year 7 · Scratch II: Subroutines and lists · Lesson 5 of 5
You will learn to
- Create a game from a flowchart, building and testing one part at a time.
- Use playtesting to find problems that another person can see.
- Fix at least two problems found by a tester, and test again.
Year 7 · Scratch II: Subroutines and lists · Lesson 5 of 5
Success criteria
You have got it when you can say:
- I can build my game in small steps and test each step.
- I can record what my tester found in a test table.
- I can fix two problems and show that they are fixed.
Year 7 · Scratch II: Subroutines and lists · Lesson 5 of 5
Retrieval starter
Questions from before. Write your answers, then show them.
- Last lesson
An 'if… else…' is…
A IterationB SequenceC Selection
C. Selection
- Last unit
The Tube map leaves out real distances. That's…
A Pattern recognitionB DecompositionC Abstraction
C. Abstraction
- Earlier this year
An email link says 'brightwell.example' but hovering shows 'brightwe11-login.xyz'. This is…
A A red flag: the real address is differentB Safe because it has HTTPSC Normal for banks
A. A red flag: the real address is different
Year 7 · Scratch II: Subroutines and lists · Lesson 5 of 5
Key words (1 of 2)
- Algorithm
- Precise, ordered, finite steps to solve a problem.
- Decomposition
- Breaking a problem into smaller ones.
- Abstraction
- Ignoring detail that doesn't matter for the problem.
- Sequence · selection · iteration
- Steps one after another. First this, then this.
Year 7 · Scratch II: Subroutines and lists · Lesson 5 of 5
Key words (2 of 2)
- Pseudocode
- Code-like writing for algorithms, without strict rules.
- Trace table
- Records variable values step by step to check logic.
- Variable
- A named place in memory that holds a value.
The explanation · step 1 of 3 · part 1 of 2
Build from your plan, one part at a time
Your flowchart is the plan. Build one part of it at a time.
- Pick the smallest part. For example: the player moves with the arrow keys.
- Build only that part.
- Click the green flag and test it.
- It works? Save, then build the next part.
- It does not work? Fix it now, before you add anything else.
The explanation · step 1 of 3 · part 2 of 2
Build from your plan, one part at a time (continued)
Small steps, and test after each one. One new bug is easy to find. Ten new bugs at once are not.
Save a new copy after each part works: maze-v1, maze-v2, maze-v3. If something breaks badly, go back one version.
The explanation · step 2 of 3 · part 1 of 2
Playtesting: let someone try to break it
Playtesting means someone else plays your game to find problems.
They have not seen your code. So they play in ways you did not expect.
- Press two keys at once.
- Walk into every wall and every edge of the stage.
- Play twice. Does the score go back to 0?
- Lose on purpose. Does the game end?
- Do something silly: click the sprite, or hold a key down.
The explanation · step 2 of 3 · part 2 of 2
Playtesting: let someone try to break it (continued)
Testers: watch and write it down. Do not take the mouse and fix it for them.
The explanation · step 3 of 3 · part 1 of 2
Record, choose, fix, test again
Write each problem in a test table. It shows what you tested and what happened.
| What we tried | What should happen | What happened | Fixed? |
|---|---|---|---|
| Walk into a wall | The player stops | The player walks through the wall | Yes: if touching the wall colour, move back |
| Play a second time | The score starts at 0 | The score starts at 7 | Yes: set score to 0 when the green flag is clicked |
| Lose all lives | The game says 'Game over' | The game keeps going | Not yet |
Fix the bugs that break the game first. Nice extras come last.
The explanation · step 3 of 3 · part 2 of 2
Record, choose, fix, test again (continued)
After each fix, play the whole game again. A fix in one place can break something somewhere else.
Year 7 · Scratch II: Subroutines and lists · Lesson 5 of 5
Worked example
Your tester says: 'When I play a second time, my score starts at 12.' How do you fix it?
- Predict: the score should start at 0 in every game.
- Find: look under
when green flag clicked. No block sets the score there. - Fix: add
set [score v] to (0)straight underwhen green flag clicked. - Test: play twice. The score starts at 0 both times. Tick it off in the test table.
Year 7 · Scratch II: Subroutines and lists · Lesson 5 of 5
Quick quiz · 1 of 3
How many times does FOR i ← 2 TO 8 repeat?
- A 6
- B 7
- C 8
B. 7
Both ends count: 8 − 2 + 1 = 7 (2, 3, 4, 5, 6, 7, 8).
Year 7 · Scratch II: Subroutines and lists · Lesson 5 of 5
Quick quiz · 2 of 3
Which loop always runs at least once?
- A REPEAT … UNTIL
- B FOR i ← 1 TO 0
- C WHILE … ENDWHILE
A. REPEAT … UNTIL
REPEAT … UNTIL checks its condition at the end, after the first run.
Year 7 · Scratch II: Subroutines and lists · Lesson 5 of 5
Quick quiz · 3 of 3
x ← 4, then x ← x × 2, then x ← x + 1. What is x?
- A 12
- B 8
- C 9
C. 9
4 × 2 = 8, then 8 + 1 = 9. Each line replaces the old value.
Year 7 · Scratch II: Subroutines and lists · Lesson 5 of 5
Exit ticket
Answer on paper before you go. Then check.
Which shape is used for OUTPUT total?
A DiamondB ParallelogramC Rectangle
B. Parallelogram Input and output are always parallelograms.
Breaking a problem into smaller parts is…
A DecompositionB IterationC Abstraction
A. Decomposition De-compose = take apart.
Year 7 · Scratch II: Subroutines and lists · Lesson 5 of 5
Homework and the challenge
Homework
Study page 12 steps 1 to 3 (searching).
End-of-unit challenge
Demo the game and explain one algorithm in it, using the correct words.