Here is my current ideal life cycle:
- Setup
- Game loop:
- UpdateSetup
- UpdateInput
- Update
- UpdateCleanup
- Draw
- DrawUI
- Cleanup
Setup: is where everything is put in place for the game loop.
UpdateSetup is meant to update stuff before user inputs are processed.
UpdateInput: should only be doing things that are related to user inputs. This step might not happen during the update phase if inputs are disabled.
Update: is for things that need to be updated regardless of user inputs. For example, animations can still happen even if inputs are disabled.
UpdateCleanup: gives the opportunity to cleanup variables before the next update phase.
Draw: is for drawing objects that belong in the game world.
DrawUI: is for drawing objects in screen space like UIs.
Cleanup: is called before something is destroyed. For example, in an in game map editor, this would be called when switching back to the game.