Time for action – fortify the town

We start with a simple game that loads a model of a town:

  1. Make a copy of Main.java and name the class PhysicsTown.java. Remember to also refactor the first line of the main() method to the following:
    PhysicsTown app = new PhysicsTown();
  2. Download a sample town model in the Ogre DotScene format from http://jmonkeyengine.googlecode.com/svn/trunk/engine/town.zip. Save it directly into your project directory (not into assets/).
  3. Register a com.jme3.asset.plugins.ZipLocator for town.zip to the assetManager. Now you can use the assetManager to load the model's main.scene into the sceneNode class field. Since the model is quite small, scale it a bit bigger. As always, you attach the loaded model to the rootNode. Remember ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.