Menu

How it works

ben0bi

First, the main function in bge.BGEEngine will get called. It initializes some stuff and creates the game window.
The state defined in bge.preferences.ApplicationPreferences.StartState will then be created and pushed on the StateManager stack.

Then it goes into the game loop where constantly bge.managers.StateManager.Update() and .Draw() will get called.

That is almost all it does "for itself". You need to make a class wich implements bge.IState with its own Update, Draw, onKeyUp and onKeyDown methods and set it as the start state to run your own game. Just after downloading the framework, a bge.State_Console will be created.

You can easily add another state (like the State_Console OVER your game) by calling bge.managers.StateManager.push(new my_state_class()). More on that in the [States] section.

Entities and the entitymanager must be created and initialized by yourself...but the stuff to do that is here. More on that in the entities section.


Related

Wiki: Home
Wiki: States

MongoDB Logo MongoDB