# 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.

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

## Usage

Use…

- Application States to implement global game mechanics
  Example: Physics, Global gameplay control
- Custom Controls to implement entity behavior
  Example: Enemy AI
- `simpleUpdate()` to implement the rest, or for testing during development.

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

view online version