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. User update – simpleUpdate() method
      2. Entity logical update – Custom Controls
    3. render
      1. Scene rendering
      2. 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.
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution 3.0 Unported