SCRATCH GOLD II
SCRATCH GOLD I
2 of 3

5.09 Space-bat

To make your game a bit harder, you are going to create a bat that throws oranges at the spaceship.

a bat throwing an orange at the spaceship

Add a Bat sprite and set its rotation style to left–right.

Make the Bat sprite move from left to right at the top of the Stage forever.

bat sprite

Remember to test your code.

If you look at the bat’s costumes, you can see that it has four different ones:

screenshot

Use the next costume block to make the bat flap its wings as it moves.

Now make the bat throw oranges!

Add an Orange sprite from the Scratch library.

screenshot

Add code to your bat so that when the flag is clicked, the Bat sprite forever waits for a random length of time between 5 to 10 seconds and then creates a clone of the Orange sprite.

bat sprite

Add code to the Orange to make each of its clone drop, starting from the Bat Asprite and falling towards the bottom of the Stage.

orange sprite

Add some more code to the Orange sprite so that when an Orange clone hits the Spaceship sprite, the clone also disappears to give the player a chance to reset:

orange sprite

Modify the code of your Spaceship sprite so that the sprite is “hit” when it touches a Hippo sprite or an Orange sprite:

rocket sprite

Test your game. What happens if the spaceship gets hit by a falling orange?

×
×

Cart