Coding the player's and the background's empty component classes
By coding an empty class for each player related component, it will allow us to more quickly write the code to get the game running. We can then flesh out the real/full code for each component as we proceed without the need of dipping into the same class (mainly GameObject
) multiple times.
In this chapter we will deal with the player (and his lasers) and the background. Coding the empty outlines will also allow us to code an error free GameObject
class that will hold all these components and we will be able to see how the components interact with the game engine via the GameObject
class before coding the details inside each component.
Each of the components will implement one of the interfaces we coded in the previous section. We will add just enough code for each class to fulfil its contractual obligations to the interface and thus not cause any errors. We will also make very minor changes outside the component classes...