That’s what I meant:
That’s explained here.
@Znnga thats a really nice set of classes you have there, I hope you don’t mind if I steal your ideas
Absolutely! Glad to be useful.
Personally I like to use a Stack of Screens (a game screen is much like a game state). The top-most screen on the stack is updated and rendered. So the contents of the Stack when the game has been started from the main menu, while the options screen is open would then be:
MainMenuScreen -> GameScreen -> OptionsScreen
With OptionsScreen being rendered and updated, and GameScreen and MainMenuScreen being inactive (they will become active when the screen on top of them gets popped off the stack).
What I do is similar but a bit more elaborated (no offence guys), one state is active at a time, I don’t directly go from the main menu state (mm) to the game state (g) because I need a dedicated state to show something to the player while loading the level (ld). I use a switch node and each state has a node which is a child node of this switch node. That way, when the current state is active, it is the only one that gets updated and rendered but a state can be used to prepare another one. I use a task manager too.