Good practices in screen states management?
- by DevilWithin
I wonder what are the best ways to organize different screens in a game?
I am thinking of it like this:
Inheriting a base State class, and overriding update and render methods, to handle the current screen.
Then, under certain events a StateManager is able to activate another Screen State, and the game screen changes as only the current State is rendered.
On the activation of a new screen, effects like fading could be added, and also the same goes for its deactivation. This way a flow of screen could be made. By saying when A ends, B starts, allowing for complex animations etc.
Toughts?