Wikijunior:Raspberry Pi/Scratch Game – Simple Maze
Tutorial by Andrew Oakley
Updated Nov 2017
Getting started edit
1. Click on the Raspberry menu, Programming, Scratch.
6. Select simple-maze and click OK.
You should now be able to move the Smiley left and right, using the left ← and right → arrow keys.
X is a "variable". A variable can hold a number or a word which can change.
X measures the left and right positions.
You should now be able to move the Smiley up and down, using the up ↑ and down ↓ arrow keys. The
Y variable measures up and down position.
The Smiley can now move anywhere around the maze, including through the walls.
We need to add rules edit
- To make the Smiley go back to the start if it hits a blue wall
- To say "You win!" if the Smiley reaches the white outline of the exit
Create this new block
To select a colour edit
To start a new game edit
What if you make a mistake? edit
For teachers / Scout / Guide leaders edit
Downloads available from http://www.cotswoldjam.org/downloads/beavers
mkdir -p Scratch/simple-maze
curl "http://www.cotswoldjam.org/downloads/beavers/cjam-scratch-simple-maze-code.zip" -O
-O is the capital letter O, not zero.
The original PDF for this tutorial is on Wikimedia Commons: cjam-scratch-simple-maze.pdf