SCRATCH GOLD II
SCRATCH GOLD I
2 of 3

5.07 Hippos that disappear

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.

rocket sprite

All of the Hippo 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 sprite

To check whether the new code works, click the green flag and make the spaceship collide with a hippo.

screenshot

After the spaceship explodes, new Hippo clones appear, but the spaceship is still exploded! The spaceship needs to reset itself after being hit.

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.

rocket sprite
×
×

Cart