Good practices in screen states management?
Posted
by
DevilWithin
on Game Development
See other posts from Game Development
or by DevilWithin
Published on 2011-02-12T03:05:05Z
Indexed on
2011/02/12
7:33 UTC
Read the original article
Hit count: 254
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?
© Game Development or respective owner