In the exercises from Chap. 6, you’ve updated the FlyingSprites example such that balloon bounces off the edge of the screen. Let’s improve this program by using classes and objects. a. Move the...


In the exercises from Chap. 6, you’ve updated the FlyingSprites example such that balloon bounces off the edge of the screen. Let’s improve this program by using classes and objects.


a. Move the behavior of the balloon to a separate Balloon class. Give the overall game class an instance of your Balloon class, and check that the game still behaves as expected. b. Modify the constructor of Balloon to include a starting position and a starting velocity. c. Add multiple instances of Balloon to the game, with different starting positions and velocities. Do you notice how the Balloon class avoids a lot of copying and pasting of code?

Nov 26, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here