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 – stir up some dust

A speeding car looks faster with rally stripes, but it looks twice as fast when it also stirs up some dust!

  1. Make a copy of Main.java and name the class Particle1DustSmoke.java. Remember to also refactor the first line of the main() method to Particle1DustSmoke app = new Particle1DustSmoke();.
  2. Copy the included file assets/Effects/smoke.png into your project's assets/Effect directory. It includes a sprite animation of a dust cloud.
  3. Create a class field for the ParticleEmitter object and initialize the emitter in the simpleInitApp() method. Give the emitter a descriptive name and tell it to keep 100 particles of type Triangle ready (from the com.jme3.effect.ParticleMesh.Type package).
    private ParticleEmitter dustEmitter; ...

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