For my game paper, we used this:
Code: Select all
//in game manager file:
class GameStateMgr;
//in current state file:
class currentState extends GameStateMgr
//when making a state:
mainStateManager = new currentState;
I'm very lazy, and for my games so far I've used this:
Code: Select all
class gameState
gameState function state1
gameState function state2
in main loop:
switch gameState->getState(){
case state1:gameState->state1
}
I'm probably missing a chapter or to from game dev 101. What's the best game state manager to use for a concrete base?