April 2017
Beginner to intermediate
394 pages
9h 16m
English
Now that we have seen the base M5Command class and UIButtonComponent class, let's look at one of the derived commands to see how it is used in the game. The command that we will look at is a common one needed in games. This is the action that will allow us to change stages from one to the next:
class ChangeStageCommand: public M5Command { public: ChangeStageCommand(M5StageTypes nextStage); ChangeStageCommand(void); virtual void Execute(void); void SetNextStage(M5StageTypes nextStage); virtual ChangeStageCommand* Clone(void) const; private: M5StageTypes m_stage; };
When used with a UIButtonComponent, this will allow the user to click a button and change to a new stage. As you can see, there are two ways to change the stage ...
Read now
Unlock full access