Time for action – fortify the town
We start with a simple game that loads a model of a town:
- Make a copy of
Main.java
and name the classPhysicsTown.java
. Remember to also refactor the first line of themain()
method to the following:PhysicsTown app = new PhysicsTown();
- 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/
). - Register a
com.jme3.asset.plugins.ZipLocator
fortown.zip
to theassetManager
. Now you can use theassetManager
to load the model'smain.scene
into thesceneNode
class field. Since the model is quite small, scale it a bit bigger. As always, you attach the loaded model to therootNode
. Remember ...
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.