Scratch game making tutorial 97

Car maze

In this tutorial you will make a game in which a car must collect all the hearts in a maze before time runs out. Beware! the maze gets harder as time runs out!

Complete these steps ..


1. Create a new game (From the top menu choose File>New).


2. Delete the cat sprite.


3. Right-click each of the following 6 background images to download and save them ..







Next, Select the stage and then click the "backgrounds" tab.

Click import to import all 6 backgrounds until you have this ..

You can delete the plain white background.


4. Add these scripts to the stage ..


5. Use File>Save as to save your game. Name it "car maze".


6. Right-click this car image, then download and save it.

Next, use the "Choose new sprite from file" button under the stage to add this image as a new sprite. Re-name it "car".


7. Add these scripts to the car ..


8. Press the "B" key and then use the mouse and space-bar to test your car.


9. If the car is driving OK, use File>Save to re-save your game.


10. Select the stage then make the following variables ("for all sprites") ..


Right-click their displays on the stage, select "large readout" and drag them to the top 2 corners like this ..


11. Add the time and score scripts to the stage ..


Now add the final scripts to control the changing backgrounds ..


12. Use File>Save to re-save your game.


13. Right-click to download the heart sprite ..

Next, use the "Choose new sprite from file" button under the stage to add it to your game.


14. Select heart 1 and add these scripts ..

Double-check your scripts are correct.


15. Right-click the "heart 1" thumbnail under the stage and duplicate it 19 times so you have 20 hearts. You may only see 1 or 2 hearts on the stage, don't worry, the duplicates may be all on top of one another.

Switch to the background "maze 6" by clicking it's costume thumbnail in the "backgrounds" tab of the stage.

Now drag the hearts on the stage to various places around the maze.


16. Paint a new sprite with a single line of 60pt red text that says "GAME OVER" ..

Re-name it "game over text".

Add these scripts to it ..


17. Use File>Save to re-save your game.


18. Well done, you're finished! Press "B" to test your game. Can you collect all 20 hearts before the time runs out?