To make your game a bit harder, you are going to create a bat that throws oranges at the spaceship.
Add a Bat
sprite and set its rotation style to left–right.
Make the
sprite Bat
move
from left to right at the top of the Stage forever
.
Remember to test your code.
If you look at the bat’s costumes, you can see that it has four different ones:
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.
Add code to your bat so that when the flag is clicked
, the
sprite Bat
forever
waits
for a random
length of time between 5 to 10
seconds and then creates a clone
of the
sprite.Orange
Add code to the
to make each of its clone drop, starting from the Orange
Asprite and falling towards the bottom of the Stage.Bat
Add some more code to the
sprite so that when an Orange
clone hits the Orange
Spaceship
sprite, the clone also disappears to give the player a chance to reset:
Modify the code of your
sprite so that the sprite is “hit” when it touches a Spaceship
Hippo
sprite or an
sprite:Orange
Test your game. What happens if the spaceship gets hit by a falling orange?