Coding the derived classes for the game screen
The structure of all these classes is the same as the select screen-related classes. I will be sure to point out where they vary, however. Most of the significant differences will be discussed across the next three chapters, however, because that is when we will code all the game objects and components and then put them to work in the GameScreen
class.
The first difference is that the GameScreen
class has two UIPanel
instances and two InputHandler
instances.
Coding the GameScreen class
Create a new header file in the Header Files/Screens/Game
filter called GameScreen.h
and add the following code:
#pragma once #include "Screen.h" #include "GameInputHandler.h" #include "GameOverInputHandler.h" class GameScreen : public Screen { private: ScreenManagerRemoteControl* m_ScreenManagerRemoteControl; shared_ptr<GameInputHandler> m_GIH; ...