Scratch game making tutorial 41

Goodie vs baddie - simple shooting game

You will create a game in which a Goodie and a Baddie fight it out.

You will control the Goodie with the arrow keys on your keyboard, and use your mouse pointer to aim, and your mouse button to fire.

The Baddie will move and fire at you automatically.

 

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").

 

Now delete the cat sprite.

 

 

2. Select the stage and add this code/script. You will need to create a new broadcast ..

 

 

3. Make these two variables ("for all sprites") ..

 

Place their displays on the stage in the top corners by dragging them ..

 

 

4. Use the Paint new sprite button under the stage and paint 4 new sprites ..

  1. Goodie
  2. Goodie bullet
  3. Baddie
  4. Baddie bullet

IMPORTANT!!! Name the sprites!

 

 

5. Use the File menu to save your game. Name it "Goodie vs baddie" ..

 

 

6. Set your Baddie and Goodie sprites to only point left-right, by clicking the middle button if you are using Scratch 1.4 ..

 

.. OR ..

..if you are using Scratch Desktop you will need to add this code block to the script/code below in step 7 ..

 

 

7. Add this code/script to the Goodie to set it's size and starting position ..

 

Adjust the "set size to" script to ensure your Goodie is NOT too big on the stage. 60% may be too big.

Use this image as a guide ..

 

Add this code/script so that the player can control the Goodie with the keyboard arrow keys ..

 

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.

 

Now add this code/script for the Goodie's health ..

 

 

8. Use the File menu to save your game.

 

 

9. Add this code/script to the Goodie bullet to set it’s size and to hide it ..

 

Now add this code/script to the Goodie bullet to allow the player to fire it ..

 

Press the "B" key on your keyboard to test your game. Control the Goodie with your left hand on the arrow keys. Use the mouse pointer position to aim, and the mouse button to fire at the Baddie.

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

 

 

10. Use the File menu to save your game.

 

 

11. Add this code/script to the Baddie to set it's size and starting position ..

 

Now add this code/script to the Baddie so that the Baddie chases the Goodie around the stage ..

 

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.

 

Now add this code/script for the Baddie's health ..

 

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/script to the Baddie bullet to set it’s size and to hide it ..

 

Now add this code/script to the Baddie bullet so that it fires automatically at the Goodie ..

 

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've finished! What can you add to the game? Better costumes? A background? More baddies?