SCRATCH GOLD II
SCRATCH GOLD I
2 of 3

8.05 Popping balloons

Lets allow the player to pop the balloons!

Click on your balloon sprite, and then click the Costumes tab. You can delete all of the other costumes, just leaving 1 balloon costume. Add a new costume, by clicking Paint new costume and create a new costume called burst.

balloon costume called burst

Make sure that your balloon switches to the right costume when the game starts. Your code should now look like this:

balloon sprite

To allow the player to burst a balloon, add this code:

balloon sprite

Test out your project. Can you pop the balloon? Does it work as you expected?

You’ll need to improve this code, so that when the balloon is clicked, it shows the burst costume for a short time, and is then hidden.

You can make all of this happen by changing your balloon when sprite clicked code to this:

balloon sprite

Now that you’re deleting the balloon when it’s clicked, you’ll also need to add a show block to the start of the when flag clicked code.

balloon sprite

Try popping a balloon again, to check that it works properly.

×
×

Cart