Goal:
Our balloon should now know how to fly to the top of the screen, and pop when it reaches the top.
Next up we need to make it pop if the player clicks it.
We will also have it send a “balloonPopped” message to the balloon that we already set up last lesson to add points for us!
Once this step is completed, the game will be complete! Feel free to play it and see how high of a score you can get!
Now that you know how to program one balloon, what would it take to program more than one? How difficult do you think this would be? Can you think of multiple ways to do this?
Be sure all your code is in the “balloon01” sprite!
Steps:
- From Events, place a “when this sprite clicked” block.
- From Control, place an if then block.
- From Operators, place an “=” block inside the if then block.
- From Variables, place a round “GameOver” block on the left side of the “=” block.
- On the right side of the “=” block type in the number 0.
- From Variables place a set to block inside the if then block.
- Set the variable to “balloonPopped” and the number value to 1.
- From Looks, place a hide block.
- From Events, place a broadcast block, and set its message to “BalloonPopped!”
- From Control, place a wait block. Be sure it says 1 seconds.
- From Events, place a broadcast block, set its message to “CreateBalloon!”