Scratch game making tutorial 132a

Dodge ball - simple (for beginners)

In this tutorial you will create a game in which a cat must dodge balls to survive.

 

Complete these steps ..

 

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

 

 

2. Select the stage by clicking on the Stage thumbnail under the stage.

 

 

3. Now select the background tab and click the "Edit" button ..

 

Use the paint bucket tool to fill the stage with black and then click "OK' when you are done ..

 

 

4. Click the cat sprite thumbnail under the stage to select the Cat (sprite1) ..

 

 

5. Click in the naming box to re-name "sprite 1" "Cat".

Now click the middle of the 3 vertical buttons to make sure the Cat cannot turn upside down. When you hover the mouse over the button you will see it is called "only face left right".

 

 

6. Now add the following script to the Cat ..

Press "B" on your keyboard and you will see the cat shrink and move to the centre of the stage.

 

 

7. Now add the next script to the cat to make it follow the mouse pointer ..

 

 

8. Add a script to end the game when you press the "E" key on your keyboard ..

 

When you are done test your game. Press the "B" key on your keyboard to begin your game, and then move the mouse-pointer around the stage. The Cat should follow it. Press "E" for end when you are ready to continue making your game.

 

 

9. Use "File>Save as" to save your game. Call it "Dodge ball"..

 

 

10. We need some moving balls for the Cat to dodge.

Click the "Paint new sprite" button under the stage ..

 

Select the paint brush tool, then the largest brush size and then a red colour and click once to paint a single ball ..

 

Click "OK" when you are done.

 

 

11. Re-name the ball "Ball 1", and then add this script to shrink it down and hide it ..

 

 

12. Add the next "Ball 1"script. This script makes the ball bounce around the stage.

Notice that the speed of the ball is at 5 ("move 5 steps").

 

 

13. Add the final Ball script which makes the ball say something when it touches the Cat ..

 

 

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

 

 

15. Press the "B" key to test your game. Use your mouse-pointer to make the Cat run away and avoid the ball.

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

 

 

16. One ball is not enough. Right-click the "Ball 1" thumbnail under the stage to duplicate it ..

 

Now you have 2 balls. Select the new copy, and then select it's Costumes tab. Now click the "Edit" button and use the paint bucket tool to change the colour of the ball ..

 

Click "OK" when you are done. You can re-name the second ball if you like.

 

 

17. Make another duplicate so you have 3 balls, and then change it's colour ..

 

 

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

You've finished this tutorial. Well done! Can you add your own ideas to the game? What about making the balls travel at different speeds?