Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.

Wrapping up States and other things

We have now finished the state system. This framework helps users create and manage their own states for use in the game engine.

The StateBase class is an abstract base class that users should inherit from when creating their own state classes. It contains functions for managing the active level and the name of the state. All clean-up and set-up for changing levels during runtime is handled within the class so the user doesn’t have to worry about it. Finally the StateBase class contains the virtual functions onEnter() and onExit() which are called when the user switches states. What they actually do is up to the user to implement.

The second part of this state-framework is the StateManager class. This is a singleton like all the other manager classes that the user calls upon when they wish to get the current state, get a state by name or to change states. Internally it only contains a std::vector full of StateBase pointers which the functions perform their functions on.

Many other parts of the engine are also reaching completion but most will probably get their own blog posts such as the GUI system, Level editor and camera property.

Be Sociable, Share!

Leave a comment  




Submit comment