O'Reilly logo

jMonkeyEngine 3.0 Beginner's Guide by Ruth Kusterer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required