Scratch exercise 34

Throw a fireball in the direction of the mouse pointer

 

Complete these steps ..

 

1. Create a new game. Either open Scratch or if it is already open choose "File>New" ..

 

 

2. Select the cat sprite under the stage, re-name it "Cat" and then click the "onlly face left right" button ..

 

 

3. Now add these script to the cat to set its starting poistion and to make it move with the left and right arrow keys ..

Press "B" on your keyboard and then the arrow keys to test your game. Press the "E" key to end it when you are ready.

 

 

3. Paint a right facing fireball, and then set the costume centre to it's tail, like this ..

Make sure the fireball is facing right.

 

Click OK to exit the paint window, re-name it "Fireball" and ensure you click the top rotation button ..

 

 

4. It is important that your fireball is not too big. It should be smaller than the Cat. Add a script like this to it ..

You need the Fireball to be smaller than the Cat sprite so "set size to" may need to be smaller than 40%.

 

 

5. Select the Cat sprite and then add this script to allow the Cat to throw it when you press the spacebar key on your keyboard ..


 

 

6. Press the "B" key to begin your game, the left and right arrow keys to move the Cat. Use your mouse to aim, and press the "space-bar" to throw a Fireball.

 

 

7. Save your game and call it "Fireball throwing".