Scratch games making tutorial 155

Turret invaders

In this tutorial you will make a game in which enemies attack from above and must be stopped before they reach the ground. Each time you kill an enemy you gain some health, but if they reach the ground you lose health. How long can you survive?

 

 

Complete these steps ..

 

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

 

 

2. Right-click on the Cat sprite on or under the stage to delete it.

 

 

3. Create these variables ..

 

Hide the "Enemy size" and "Enemy speed" variables. Position the Lives and Timer variable displays in the top corners on the stage like this ..

 

 

4. Select the stage, and paint it black with a thin yellow strip across the bottom edge ..

 

Now add these scripts ..

 

Note that the enemy speed increases as the game goes on, making it harder.

Also note that you can set the enemy size here.

The timer is used to record how long the player survives. The longer the better.

 

5. Download, save and then use the "Choose new sprite from file" button under the stage to locate and import these sprites ..

Turret.sprite

Bullet.sprite

Enemy.sprite

Friend.sprite

 

 

6. Use "File>Save as" to name and save your game. Name it "Turret invaders" ..

 

 

7. Select the Turret sprite and add its scripts ..

 

 

8. Now select the Bullet sprite and add it's scripts ..

 

Press the "B" key on your keyboard to test your game. Use the space key on your keyboard to fire and your mouse-pointer to aim.

When you are ready press the "E" key to end your game.

 

 

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

 

 

10. Select the Enemy sprite and add it's scripts ..

 

Press the "B" key on your keyboard to test your game. You should gain a life when you destroy it and lose a life if it reaches the ground.

When you are ready press the "E" key to end your game.

 

 

11. Select the Friend sprite and add it's scripts ..

 

Press the "B" key on your keyboard to test your game. You must avoid hitting the Friend sprite or you will lose 2 lives.

When you are ready press the "E" key to end your game.

 

 

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

 

 

13. The game is too easy. Right-click the Enemy sprite under the stage and duplicate it 3 times so you have 4 enemy sprites. Duplicate the Friend sprite once.

 

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

When you are ready press the "E" key to end your game.

 

 

14. Use "File>Save" to re-save the game ..

 

 

15. Well done, you've finished this tutorial. Can you improve the game?