(Game: hitting balloons) Write a program that displays a balloon in a random position in a panel (Figure 16.26(a)). Use the left- and right-arrow keys to point the gun left or right to aim at the balloon (Figure 16.26(b)). Press the up-arrow key to fire a small ball from the gun (Figure 16.26(c)). Once the ball hits the balloon, the debris is displayed (Figure 16.26(e)) and a new balloon is played in a random location (Figure 16.26(f)). 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 right-arrow 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; 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.