Ball, game, gameTestProgram, player, prize trap, wall class are given. And please show result
1) The project begins with files that are used to represent a Game of Trap "ball tag" in which a Player (who is "it') chases other players around a Walled environment with a Ball and tries to hit them with it. When the a player gets hit with the ball. they become "it and try throw the ball at the other players. Each time a player hits another helshe gains points and when a player gets hit. Prize he/she loses points. Assume that the environment has rectangular walls that prevent Ball movement in certain directions. Also assume that there are Traps where a player cannot run into, otherwise he/she loses points. Lastly, assume that there are Prizes that the players can collect for bonus points while running around. Player Some classes for this game have been developed and they form the class hierarchy shown below: Object Ball Game Wall Player Prize Trap Examine the classes and look at the attributes (i.e., instance variables). You will notice that there is a lot of duplicate information. For example, Ball, Wall, Player, Prize and Trap all keep track of a location, and Ball and Player both have a direction and speed. This is not very nice. To eliminate the duplication, we will re-organize the classes by abstraction (i by extracting the common attributes and behaviors One way of doing this would be to see what all objects have in common. It seems that all objects except Game have a location. So we will begin by getting that information out from the objects and storing it in a common class which they can all inherit from. 1) The project begins with files that are used to represent a Game of Trap "ball tag" in which a Player (who is "it') chases other players around a Walled environment with a Ball and tries to hit them with it. When the a player gets hit with the ball. they become "it and try throw the ball at the other players. Each time a player hits another helshe gains points and when a player gets hit. Prize he/she loses points. Assume that the environment has rectangular walls that prevent Ball movement in certain directions. Also assume that there are Traps where a player cannot run into, otherwise he/she loses points. Lastly, assume that there are Prizes that the players can collect for bonus points while running around. Player Some classes for this game have been developed and they form the class hierarchy shown below: Object Ball Game Wall Player Prize Trap Examine the classes and look at the attributes (i.e., instance variables). You will notice that there is a lot of duplicate information. For example, Ball, Wall, Player, Prize and Trap all keep track of a location, and Ball and Player both have a direction and speed. This is not very nice. To eliminate the duplication, we will re-organize the classes by abstraction (i by extracting the common attributes and behaviors One way of doing this would be to see what all objects have in common. It seems that all objects except Game have a location. So we will begin by getting that information out from the objects and storing it in a common class which they can all inherit from