Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javagame;
- import java.io.File;
- import java.net.URL;
- import java.net.URLDecoder;
- import org.newdawn.slick.Image;
- import org.newdawn.slick.particles.ConfigurableEmitter;
- import org.newdawn.slick.particles.ParticleIO;
- import org.newdawn.slick.particles.ParticleSystem;
- public class Particle {
- public ParticleSystem system;
- public ConfigurableEmitter emitter;
- Image particleImage;
- String path;
- URL xmlFile;
- File file;
- int angle;
- public Particle(String path,float x,float y){
- try {
- particleImage = new Image("res/particles/particle.png", false);
- system = new ParticleSystem(particleImage,1500);
- //load the xml file and add the emitter to the system
- File xmlFile = new File("res/particles/bloodDown.xml");
- ConfigurableEmitter emitter = ParticleIO.loadEmitter(xmlFile);
- emitter.setPosition(315, 358);
- system.addEmitter(emitter);
- } catch (Exception e) {
- System.out.println("Exception: " +e.getMessage());
- e.printStackTrace();
- System.exit(0);
- }
- system.setBlendingMode(ParticleSystem.BLEND_ADDITIVE);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement