Hi all. I know Marte Engine is discontinued but I already started a project with it and its too late for me to switch to another engine before I finish this project. My question is about the ParticlesEntity class - I create a class that extends it and then I add the entity in the level World but its not showing anywhere. Do I have to use the old way to build particle systems like in slick2d?
here is my code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| public class Effect extends ParticlesEntity {
public Effect(float x, float y, Image particle, ConfigurableEmitter emitter) { super(x, y, particle, emitter); this.depth = 150; }
@Override public void update(GameContainer container, int delta) throws SlickException { super.update(container, delta); }
@Override public void render(GameContainer container, Graphics g) throws SlickException { super.render(container, g); }
}
=========
in the level class (extends World)=================
File xmlFile = new File("data/healing.xml"); try { ConfigurableEmitter emitter = ParticleIO.loadEmitter(xmlFile); emitter.setEnabled(true); } catch (IOException e) { e.printStackTrace(); System.out.println("particle config file not found/ cant be accessed"); } particle = new Image("data/plus.png"); add(new Effect(200, 200, particle, emitter)); |