Scratch game making tutorial 117

Milk drinker - simple

In this tutorial you will create a game in which the Cat must avoid an enemy to drink the milk. The cat can draw fences to stop the enemy.

 

Complete these steps ..

 

1. Create a new game, select the stage and then click the background tab. Click "edit" and fill the stage with a bright green colour.

 

 

2. Create these variables ("for all sprites") ..

 

 

3. Add these scripts to the stage ..

 

 

4. Select the cat sprite. Re-name the sprite "Cat" and then, click the direction button to make sure the Cat can only face left-right ..

 

Now add the first script ..

 

 

6. Add the next cat script. This script makes the cat move automatically and allows the player to steer the cat with the arrow keys ..

 

 

7. Add the next cat script. This script allows the cat to draw a yellow line, which the enemies cannot cross, when you press the space-bar ..

Press the "B" key to test your game. Use the arrow keys to steer the cat and press the space-bar to draw a yellow line. Press "E" to end when you are done.

 

 

8. Use "File>Save as" to save your game. Name it "Milk defender".

 

 

9. Add the next cat script. This script clears the yellow lines the cat has drawn, every 20 seconds ..

 

 

10. We need to create an enemy sprite that will chase the Cat. Either draw your own or ..

 

.. download and save this sprite ..

Now use the "Choose new sprite from file" button under the stage to load it ..

 

 

11. Select the Enemy 1 sprite, then click the direction button to make sure it can only face left-right.

Now add the first script ..

 

 

12. Add the second Enemy 1 script. This script makes the sprite chase the cat, but stops it when it touches a yellow line ..

Press the "B" key to test your game. Press "E" to end when you are done.

 

 

13. Use "File>Save" to re-save your game.

 

 

14. We need to import a milk bottle sprite. Download and save this sprite ..

Now use the "Choose new sprite from file" button under the stage to load it ..

 

 

15. The Milk bottle will appear at random times and locations on the stage.

Select the Milk bottle sprite and add the first script ..

 

 

16. Now add the second Milk bottle script ..

 

Press the "B" key to test your game. Press "E" to end when you are done.

 

 

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

 

 

18. Well done. You've finished. What new ideas can you add to this game?