Scene Life Cycle
Understand the life cycle of your Game Scene
The graph below shows an overview of your Game Scene Life cycle. The entire life cycle can be divided into two phases, the Initialization Phase, and the Game Loop.
The Initialization Phase begins when your Scene Class is instantiated and finishes when the init() terminates. There are four (4) steps during the initialization.
- The first two steps Instantiate Scene and Build Scene are perform by the Engine in which the Scene is currently running.
- The last two steps CheckSceneObject and Init are performed by you when you override and implement the two methods :
- virtual void checkSceneObject()
- virtual void init()
The Game Loop begins with the method HandleEvent() and cycle with the methods Update(), Render(), RenderShape() and RenderFrontScreen(). The loop continues indefinitely until you explicitly ask the Engine to quit the Game.
The Engine runs with a Frame Rate of 60 FPS (Frame Per Second), Each Frame takes approximately 16.7 milliseconds. Most of this time is consumed to render your Game. Handle events and update the Game goes generally fast unless a complex AI System is running during the update.