Creating the intro state
It seems rather fitting to start with the intro state, in turn giving the state manager a bit of an introduction at the same time. As always, a good place to start is with the header file, so let's get going:
class State_Intro : public BaseState{ public: ... void Continue(EventDetails* l_details); private: sf::Texture m_introTexture; sf::Sprite m_introSprite; sf::Text m_text; float m_timePassed; };
The State_Intro
class, just like all the other state classes we'll build, inherits from the BaseState
class. All of the purely virtual methods of the base class have to be implemented here. In addition to that, we have a unique method named Continue
and some private data members that will be used in this state. Predictably enough, we will be rendering a sprite on screen, as well as some text. The floating point data member on the very bottom will be used to keep track of how much time we have spent in this state, in order to present the user with...