Scratch game making tutorial 182

Death star arcade

In this tutorial you will make a game in which the player must control the Rocket to destroy the Death Star, and avoid its Mines, before the Rocket loses its lives.

 

NOTE: You need to use Scratch Desktop (version 3 of Scratch) or higher.

 

Complete these steps ..

 

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

 

 

2. Download, save and then load this game file into Scratch Desktop ..

 

 

3. Select the stage and add this code ..

 

 

4. The game uses 6 sprites ..

 

The player controls the Rocket sprite and fires Rocket Missiles at the Death Star sprite. Both of these sprites need lives, so create the following variables ("For all sprites") ..

 

Arrange them on the stage like this ..

 

 

5. Select the Rocket sprite and add its properties code ..

 

 

6. Now add the code to control it's movement and to make it repel (turn and move away) when near the Death Star sprite ..

 

Now add the repel sound effect code ..

 

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.

 

 

7. When the Rocket is repelled it would be good if it doesn't get stuck at the edge of the stage. Add this code to make it reappear at the opposite stage edge ..

 

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. Name it "Death Star Arcade v1.sb3"..

 

 

9. The Death Star fires mines which can damage the Rocket. Add this code ..

 

You cannot test this code until the Death star mine sprite has been coded.

 

 

10. The Rocket sprite has a Rocket Trail which follows it. It's a cool effect.

Add this code to the Rocket Trail sprite ..

 

Notice how the Rocket Rail is made of clones which appear then shrink and fade away before deleting.

 

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.

 

 

11. Use the File menu to save your game.

 

 

12. Select the Death Star sprite and add its properties code ..

 

Now add the code to move it ..

 

And finally, add the code to make it reappear on the opposite edge when it leaves 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.

 

 

13. When the Death Star is hit by a Rocket Missile it will lose lives and fade.

Add this code ..

 

Now add the code to make it animate when hit ..

 

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.

 

 

14. Use the File menu to save your game.

 

 

15. Select the Death Star mine sprite and add its properties code and the code to create 20 mines ..

 

Each mine will move at its own different speed. We need a variable for this. Create the variable Mine speed "For this sprite only".

When the mine clones, each variable will be individual, it's like creating 20 variables, one for each mine ..

 

Hide the variable on the stage..

 

Now add the code to make the mines randomly fire from the Death Star 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.

 

 

16. Use the File menu to save your game.

 

 

17. Select the Rocket missile sprite and add its properties code

 

Now add the code to fire it when the mouse-pointer is clicked ..

 

Add the sound effect code ..

 

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.

 

 

18. Finally, select the Game over sprite. Notice that it has 2 costumes ..

 

Now add its code ..

 

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.

 

 

19. Use the File menu to save your game.

 

 

20. Well done, you've completed this game tutorial. Can you improve it?

 

Scratch cat and code blocks video screenshot Scratch coding online video courses

Our Scratch coding online video courses are an ideal way for your child to experience our lessons at home, if attending a course or club is inconvenient for you, or if you are waiting to attend a taster session, or an activity.
£24.99 or less