Scratch game making tutorial 97

Scratch cat and code blocks video screenshot Scratch coding video lessons

Our Scratch coding online video lessons are an ideal way for your child to experience our lessons at home.
Try a FREE lesson.



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!

NOTE: You can use any version of Scratch.

 

Complete these steps ..

 

1. Open Scratch, OR create a new game (from the top menu choose "File>New").

 

 

2. Download, save and then open this game file ..

 

 

3. Add this code/scripts to the stage ..

 

 

 

4. Add this code/scripts to the car ..

 

Press the "B" key on your keyboard to test your game.

When you are ready, press the "E" key to end your game and continue working on it.

 

 

5. Use the File menu to save your game. Name it "Car maze v1" ..

 

 

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

 

Right-click the variables displays on the stage, then select "large readout" and drag them to the top 2 corners like this (ignore the hearts for now, you will import them later) ..

 

 

7. Add the time and score code/scripts to the stage ..

 

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

 

Press the "B" key on your keyboard to test your game.

When you are ready, press the "E" key to end your game and continue working on it.

 

 

8. Use the File menu to save your game.

 

 

9. Select heart 1 and add this code/scripts ..

Double-check your scripts are correct.

 

Press the "B" key on your keyboard to test your game.

When you are ready, press the "E" key to end your game and continue working on it.

 

 

10. 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.

 

 

11. Select the stage and 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 random places around the maze. Spread them out.

 

Press the "B" key on your keyboard to test your game.

When you are ready, press the "E" key to end your game and continue working on it.

 

 

12. Add this code/scripts to the "game over text" sprite ..

 

Press the "B" key on your keyboard to test your game.

When you are ready, press the "E" key to end your game and continue working on it.

 

 

13. Use the File menu to save your game.

 

 

14. Well done, you're finished! Can you collect all 20 hearts before the time runs out?