# Update Loop

Extending your application from com.jme3.app.SimpleApplication provides you with an update loop. This is where you implement your game logic (game mechanics).

Examples: Here you remote-control NPCs (computer controlled characters), generate game events, and respond to user input.

- Initialization – `simpleInitApp()` method
  1. Input handling – input listeners
  2. Update game state
     1. Application States update
     2. User update – `simpleUpdate()` method
     3. Entity logical update – Custom Controls
  3. render
     1. Application States rendering
     2. Scene rendering
     3. User rendering – `simpleRender()` method
- If exit is requested, then cleanup and destroy
- Repeat

## Usage

There are two strategies how advanced developers can spread out their init and update code over several Java objects:

- Move code blocks from the simpleInitApp() method to AppStates.
- Move code blocks from the simpleUpdate() method to Custom Controls to control entity behavior.

basegame, control, input, init, keyinput, loop, states, state

view online version