Scratch games making tutorial 180

Girl vs witch

In this tutorial you will code a game in which a Girl must avoid a chasing Witch to collect crystals.

 

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 open this game file ..

 

You will have these sprites ..

 

 

3. Select the stage, and add this code to begin and end your game with key presses and to start the background music playing ..

 

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.

 

 

4. We need 3 variables ("For all sprites") so create them now ..

 

Now arrange them on the stage like this ..

 

 

5. Select the Girl sprite and add it's properties code ..

 

 

6. Now add the code to control the movement of the Girl with key presses. You can use the W A S D keys if you prefer.

Ensure you nest the "or" code blocks correctly like this ..

 

 

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. It will be better if the Girl can leave the left and right edges of the stage and reappear on the opposite edges. Add this 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.

 

 

8. Use the File menu to save your game. Name it "Girl vs witch v1.sb3" ..

 

 

9. The Girl will lose lives if the Witch catches her. Add this 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.

 

 

10. The Girl can throw Fireballs to repel the Witch.

Select the Fireball sprite and add its properties code ..

 

Now add the throwing 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.

 

 

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

 

 

12. Select the Witch sprite and add it's properties code ..

 

Now add the code to make her cape flutter and brown shake as she flies ..

 

Now add the code to make the Witch chase the Girl and retreat if she is hit by a Fireball ..

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 "File>Save to your computer" to re-save your game.

 

 

14. The Witch will lose lives when she is hit by a Fireball. Add the 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.

 

 

15. The Girl will collect Crystals. Select the Crystal sprite and add its properties code ..

 

Now add the code to spread the Crystals around the stage, make then move, and disappear when the Girl touches them ..

 

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 "File>Save to your computer" to re-save your game.

 

 

17. Well done, you've completed this game. Can you improve it with your own ideas?

 

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