(Game: hit balloons) Write a program that displays a balloon in a random position in a panel (Figure 16.27a). Use the left- and right-arrow keys to point the gun left or right to aim at the balloon (Figure 16.27b). Press the up-arrow key to fire a small ball from the gun (Figure 16.27c–d). Once the ball hits the balloon, the debris is displayed (Figure 16.27e) and a new balloon is displayed in a random location (Figure 16.27f). If the ball misses the balloon, the ball disappears once it hits the boundary of the panel. You can then press the up-arrow key to fire another ball. Whenever you press the left- or the rightarrow key, the gun turns 5 degrees left or right. (Instructors may modify the game as follows: 1. Display the number of the balloons destroyed; 2. Display a countdown timer (e.g., 60 seconds) and terminate the game once the time expires; and/or 3. allow the balloon to rise dynamically.)
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.