Coding the derived classes for the select screen
So far, we have coded the fundamental classes that represent the user interface, as well as the logical division of our game into screens. Next, we will code specific implementations of each of them. Remember that Space Invaders ++ will have two screens: select and game. The select screen will be represented by the SelectScreen
class and will have a single UIPanel
instance, a single InputHandler
instance, and two buttons. The play screen will be represented by the GameScreen
class and it will have two UIPanel
instances. One is called GameUIPanel
and will display the score, lives, and invader wave number. The other is called GameOverUIPanel
and will display two buttons, giving the player the option to go back to the select screen or play again. As the GameScreen
class is composed of two UIPanel
instances, it will also be composed of two InputHandler
instances.
Coding the SelectScreen class
Create a new header file in the Header...