ScratchProgrammingMaterial PDF
ScratchProgrammingMaterial PDF
Scratch Program
Maze Adventure
Table of Contents
At the moment our cat is way too big – use the “Shrink Sprite”
button, then click the Cat a few times to make him very small.
(Check the front cover for the size)
Shrink Sprite
In this game, we will use the arrow keys to control the Cat.
TRY IT! You should be able to control the Cat with the arrows!
Next time, to open your file, simply load scratch and click
A similar dialog box will appear – you can use this to find your file
(remember where you saved it) and load it.
If you make a mistake, you can use the Undo or Clear buttons
Now select a Blue colour and use the FILL tool to colour the
background blue:
Click OK, and you will see the new background applied to your
Project.
This time use the ‘Line’ tool and make a Cross, then click OK.
Use the Shrink Sprite / Enlarge Sprite buttons to make it the right
size. (Look at Step 2 if you forgot)
We want it to rotate over and over again, which means we must use
a loop. We will use the ‘Forever’ loop as we want it to rotate
throughout the game.
Try changing the number of degrees and watch the effect this has.
Click the ‘Paint New Sprite’ button and draw a black rectangle.
(Look at Step 6 if you forgot)
Use the Shrink Sprite / Enlarge Sprite buttons to make it the correct
size.
(Look at Step 2 if you forgot)
Click the green flag and lets see if you can use the arrow keys to
guide the Cat to the red rectangle!
You should have been able to get the Cat to the red rectangle very
easily – because nothing happens if he touches a black area!!
The object of our game is to get the Cat to the red rectangle
without touching any Black obstacles.
If the Cat does touch the colour black, he should return to his
starting position at the top left corner of the screen.
From the ‘Sensing’ tab, drag in the ‘touching colour ..’ block and
snap it in the Condition Space, as shown:
Now click on one of the Black areas of your game – you should see
the colour square change to black:
Now add the following block to the module so it looks like this:
“If you ever touch the colour black, return to your starting
co-ordinates”
TRY IT! Click the green flag to start your game – you should see
that the cat returns to its starting position whenever it
touches a black area!
It is important to make sure the Cat starts at the same position for
each game. To do this, we need to change the module we just
created:
Change to
This sets the Cats starting position at the beginning of each game.
At the moment, there is no ‘sign’ that we have won the game if the
Cat gets to the red area.
We want the Cat to say ‘Yipee! I did it!!!’ if he touches the red area.
This module will be very similar to the one used in Step 11 – so you
can look back at this step if you get stuck.
TRY IT!! Click the green flag and test your game.
Well Done! You have just created the Maze Adventure game!!
Module Library
Here you will find all the modules used in the game and what
they do.
You should now use what you have learned to create your very own
computer game, similar to ‘Maze Adventure’.
Remember to use the Module Library to help you if you get stuck.
Good Luck!