A speeding car looks faster with rally stripes, but it looks twice as fast when it also stirs up some dust!
Make a copy of
Main.java
and name the classParticle1DustSmoke.java
. Remember to also refactor the first line of themain()
method toParticle1DustSmoke app = new Particle1DustSmoke();
.Copy the included file
assets/Effects/smoke.png
into your project'sassets/Effect
directory. It includes a sprite animation of a dust cloud.Create a class field for the
ParticleEmitter
object and initialize the emitter in thesimpleInitApp()
method. Give the emitter a descriptive name and tell it to keep 100 particles of typeTriangle
ready (from thecom.jme3.effect.ParticleMesh.Type
package).private ParticleEmitter dustEmitter; public void simpleInitApp() { dustEmitter = new ParticleEmitter("dust emitter", Type.Triangle, 100);
Like every visible scene object, an emitter has a material. An effect material is always based on the
Common/MatDefs/Misc/Particle.j3md
material...