Question: In Java You are going to define an inheritance heirarchy for four types of games objects: The Ship controlled by the player The Laser fired
In Java You are going to define an inheritance heirarchy for four types of games objects:
The Ship controlled by the player
The Laser fired by the ship
The Aliens attacking
Missiles fired by aliens
In order to do this, you will define an abstract class called GameObject. The reason this class is abstract is because we dont want to be able to create instances of this class. However, we want it to be able to define certain functionalities for space invaders game objects. To make sure that this is done, your class must implement the supplied ObjectD interface. The ObjectD interface specifies seven methods. These methods must be implemented for each type of game object, either through inheritance from the abstract class, or in the concrete classes. The ship and aliens are able to fire lasers and missiles, respectively. In order to do this, Ship and Alien must appropriately implement the provided Shooter interface. When a ship fires and creates a laser, the Laser should be centered horizontally above the ship. Its dimensions should be as specified in the GameData interface, which defines some common constants for the game. Similarly, a new Missile should be centered below the alien that fired it
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
