Scratch exercise 24

Throw a ball

In this exercise you will learn how to make one sprite (the Cat) throw another sprite (a ball).

 

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

 

 

2. Select the cat sprite under the stage and re-name it "Cat". Then select the "only face left right" button ..

If you are using Scratch desktop add this code ..

 

3. Now, add this code to the cat sprite ..

 

Now add the code to allow the player to move the Cat with the arrow keys on their keyboard ..

 

Press the "B" key to begin your game and then use the left and right arrow keys to make the Cat walk.

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

 

 

4. Make a simple ball by painting a new sprite.

Click on the "Paint new sprite" button under the stage to open the Paint window.

 

Now select the circle tool and hold down the shift key on your keyboard as you drag the mouse-pointer to create a perfect circle.

 

When you are done, click "OK" and then re-name the sprite "ball".

 

 

5. Add this code to the ball to allow the Cat to throw it whenever the player presses the spacebar on your keyboard ..

 

Press the "B" key to begin your game and then use the left and right arrow keys to make the Cat walk.

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

 

 

6. Use the File menu to save your game. Name it "Throw a ball v1" ..

 

 

7. Well done, you've finished!