// set the original emitter in the middle of the screen at the top
explosionEmitter.setPosition(400,100);
// create 5 duplicate emitters
for (int i = 0; i < 5; i++) {
// a single duplicate of the first emitter is created here
ConfigurableEmitter newOne = explosionEmitter.duplicate();
// we might get null as a result - protect against that
if (newOne == null)
throw new SlickException("Failed to duplicate explosionEmitter");
// give the new emitter a new unique name
newOne.name = newOne.name + "_" + i;
// place it somewhere on a row below the original emitter
newOne.setPosition((i+1)* (800/6), 400);
// and add it to the original particle system to get the new emitter updated and rendered
explosionSystem.addEmitter(newOne);
}
} catch (IOException e) {
throw new SlickException("Failed to load particle systems", e);