Before You Start: Sprites vs Backgrounds
This is the biggest mistake students make — drawing the sprite on the stage.
Click the infographic to enlarge
You cannot watch the whole video and remember every step. Instead: watch ~30 seconds, pause, then build that section in Scratch. Repeat.
Split your screen so you can see Scratch and the video at the same time.
Windows: open Scratch and the worksheet/video, then press Windows key + Left Arrow to snap one app to the left. Click the other window to fill the right.
If you want Scratch bigger: drag the divider so Scratch takes about 2/3 of the screen and the video takes 1/3.
- Sprites move and have code
- Backgrounds (Stage) are the maze levels
- Sprites use the Costumes tab
- Backgrounds use the Backdrops tab
Set Up the Project
Delete the cat, log in, and name your project so it saves properly.
- Log in to Scratch
- Name the project: Maze Game
- Delete the Scratch cat sprite
Create a Sprite the Correct Way
Important: HOVER over the cat icon to reveal the paintbrush. Don’t click it directly.
- Go to the Sprite area (bottom-right)
- HOVER over the cat face
- Click the paintbrush (not the sprite library)
Draw the Player Sprite
Make a square sprite and centre it perfectly on the crosshair.
- Go to Costumes
- Outline: Invisible
- Fill: choose a colour (e.g., red)
- Hold SHIFT to draw a perfect square
- Move the square so its centre sits on the crosshair
- Check: Tab says Costumes (if it says Backdrops, you’re on the stage)
- Use the magnifying glass to zoom in if it’s fiddly
- If the sprite looks ‘wonky’ when moving, re-centre it on the crosshair
Add Basic Movement Code
Green flag starts movement + arrow keys change direction.
- Events: when green flag clicked
- Motion: go to x/y (start position)
- Motion: point in direction
- Control: forever → Motion: move 2 steps
- Four IF blocks (not nested) for arrow keys → change direction
- Move the sprite to your start position in the Code window (not in Costumes)
- Use the go to x/y block so it always resets to the same start point
- If it’s too fast, lower the move steps number (e.g., 2)
- Duplicate the IF blocks and snap them directly underneath (don’t put them inside each other)
Create Level Backdrops
Make three maze levels on the Stage (Backdrops tab), each with a different finish square colour.
- Click Stage → Backdrops
- Create: Level 1, Level 2, Level 3
- Walls: one wall colour (same across all levels)
- Finish: different colour square at the end of each level
- Levels should get harder each time
- Wall colour must be different to your sprite colour (or it will constantly reset later)
- Keep the same wall colour across all levels (don’t add extra colours to the walls)
- Use arrow keys to nudge shapes into position neatly
- Test each level: can your sprite actually fit through the gaps?
Broadcasts: Level Switching + Reset on Wall
Touching wall resets. Touching finish broadcasts “Level 2 / Level 3 / Winner”.
- Looks: switch backdrop to Level 1 at start
- IF touching wall colour → go back to start
- IF touching finish colour → broadcast Level 2/3/Winner
- Use the pipette to pick colours exactly
- Add broadcasts: Level 2, Level 3, and Winner (create new message each time)
- After broadcasting: wait 1 second → go to start → switch backdrop
- Create receiver scripts: when I receive Level 2 and when I receive Level 3
- For colour checks: click the colour square → use the pipette (don’t try to match it by eye)
Winner Backdrop
Make a “Winner” backdrop and switch to it when the game is completed.
- Create new backdrop: Winner
- Text tool: write “WINNER”
- On Winner broadcast: switch backdrop → wait 4 seconds → switch back to Level 1
- Rename the backdrop to Winner (so it matches your code dropdown)
- After switching to Winner: wait 4 seconds so the player can see their result
- Then switch back to Level 1 so the game restarts
Add Obstacles (Hide / Show by Level)
Obstacles should only appear on certain levels using broadcasts.
- Create obstacle sprite (rectangle)
- Use wall colour (pipette) so it “matches”
- When I receive Level 1 → hide
- When I receive Level 2 → show + spin (slowly)
- When I receive Level 3 / Winner → hide
- At the top of your main code: broadcast Level 1 (so obstacles know the game has started)
- On obstacles: Level 1 hide, Level 2 show, Level 3 hide, Winner hide
- Make it fair: slow the spin (e.g., turn 1 degree)
Add a Score
Make a variable called Score and increase it when each level is completed.
- Variables → Make a variable: Score
- At start: set Score to 0
- At each finish: change Score by 1
- Challenge: Why might it not reset after Winner?
- Make sure set score to 0 is under the green flag
- Put change score by 1 inside each finish-colour IF block (before long waits)
- Challenge: if score doesn’t reset after Winner, where else could you set it back to 0?
Extension Challenges (Choose Your Own)
Add one extra feature using variables and IF statements. Test and debug it properly.
Bronze (Accessible)
🟩 Key and Door (Single Level) — Add a key that must be collected before the door lets you finish the level.
- Create a key sprite.
- Create a variable called
has key(for all sprites). - When the player touches the key:
- Hide the key
- Set
has keytoyes
- At the door:
- If touching door and
has key = yes→ finish the level - Else say: “You need the key!” (optional)
- If touching door and
🟩 Timer Challenge — Add a countdown timer. Reach the exit before time runs out.
- Create a variable called
time. - At level start, set
timeto 30 (or 20). - Create a timer script:
- Repeat until finished:
- Wait 1 second
- Change
timeby -1 - If
time = 0→ broadcastrestart
- Repeat until finished:
Silver (Requires planning)
🟦 Enemy That Moves (Patrol) — Add an enemy that patrols and sends the player back if touched.
- Create an enemy sprite (simple shape is fine).
- Make it move left/right (or up/down) in a loop.
- Use wall detection to turn around:
- If touching wall colour → turn 180 degrees
- If the enemy touches the player → broadcast
restart.
🟦 Destructible Wall — Add a wall that disappears only after collecting an item (switch / bomb / button).
- Create a wall sprite that blocks a shortcut.
- Create a switch/bomb/button sprite somewhere else.
- Create a variable
wall openset tonoat level start. - When player touches the switch:
- Set
wall opentoyes - Hide the switch (optional)
- Set
- Wall sprite checks:
- If
wall open = yes→ hide - Else → show
- If
Gold (Stretch / mastery)
🟨 Multiple Keys, Multiple Doors — Add more than one key and door pair (e.g., red key opens red door).
- Option A: make variables
red key,blue key(values yes/no). - Option B: make one variable
key(values none/red/blue). - Each door checks the matching condition before allowing progress.
- Reset your key variables when restarting or changing level.
🟨 Enemy With “AI” Behaviour — Create an enemy that follows the player when nearby (otherwise it patrols).
- Enemy runs a loop forever.
- If
distance to player < 120:- Point towards player
- Move slowly (e.g., 1–2 steps)
- Else:
- Patrol like a normal enemy (turn at walls)
- If touching player → broadcast
restart.
Platinum (Open-ended)
🟪 Choice-Based Maze (Fork with Consequences) — Add a fork in the maze where each path has different risks or rewards.
- Path A is shorter but has an enemy; Path B is longer but safe.
- Path A contains the key; Path B is a shortcut but needs the key later.
- Path A gives bonus points; Path B removes time from the timer.
🟪 Self-Check (Use for Any Challenge) — Use this checklist to prove your extension is complete.
- My maze still works (movement + walls + finish).
- I tested my new feature at least 3 times.
- I can explain which variable(s) I used and what they store.
- I can explain at least one condition (IF) in my code.
- I reset everything properly on restart / new level.
Success criteria:
- Your original maze still works (movement + walls + finish + levels).
- Your new feature is reliable (tested at least 3 times).
- You can explain your code using: variable, condition, broadcast, loop.