When the spaceship explodes, all the hippos should disappear so that players of the game can recover.
Add code to the spaceship sprite to make it broadcast
the message “hit” when the spaceship touches a hippo
.
All of the
sprite clones will receive the “hit” message, and you can instruct them to disappear when the spaceship is hit by adding this code to the Hippo
sprite:Hippo
To check whether the new code works, click the green flag and make the spaceship collide with a hippo.
After the spaceship explodes, new
clones appear, but the spaceship is still exploded! The spaceship needs to reset itself after being hit.Hippo
Add a wait
block at the end of the Spaceship
sprite’s code to create a small pause before hippos begin appearing again. Then add a forever
block around all of your code to make the code run repeatedly.