Objects disappearing
When we play the game we have created so far, we may want more to happen when the red bar hits a ball. Let's follow this recipe to make the ball disappear from the stage.
Getting ready
Continue with the game we've been making all along in this chapter. There isn't much we need to prepare, as long as you've been following the recipes up until now.
How to do it...
Apply the following to each bouncing ball sprite:
Under the Looks category, find the hide block. Drag this to our script that controls bouncing off of the red bar.
Under any of the green flag top hat blocks, drop a show block from the Looks category between the top hat block and the loop.
How it works...
By adding these two simple blocks we can make it so that each time the game starts, all of the bouncing balls are brought back on the stage. As soon as they touch the red bar, they will disappear for the remainder of the game.
You might notice, though, that the score will keep increasing. This is because those bouncing...