Time for action – get into the right AppState of mind

When you notice that a control class has ambitions to make decisions on the application level, this is a sign that this control class has evolved to something else—an application state (AppState). We want the application to do the same thing as before—let us chase the random subset of cubes that carry the CubeChaserControl class.

  1. Create an AppState class CubeChaserState that extends the AbstractAppState class from the com.jme3.app.state package. This class will contain our game logic.
  2. Copy the following minimum template into the CubeChaserState class:
    public class CubeChaserState extends AbstractAppState { @Override public void update(float tpf) {} @Override public void cleanup() {} @Override ...

Get jMonkeyEngine 3.0 Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.