Time for action – fit to burst?
If you have game scenes where bullets or other projectiles hit a target, you may have thought of emphasizing the impact with a short fiery burst.
- Make a copy of
Main.java
and name the classParticle5Burst.java
. Remember to also refactor the first line of themain()
method toParticle5Burst app = new Particle5Burst();
. - Copy the included file
assets/Effects/flash.png
into your project'sassets/Effect
directory. It includes a sprite animation of a fiery burst. - Since a burst is short and compact, we create an emitter with only five particles in the
simpleInitApp()
method:public void simpleInitApp() { ParticleEmitter burstEmitter = new ParticleEmitter("Burst emitter", Type.Triangle, 5); rootNode.attachChild(burstEmitter); ...
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.