Advertisement
Guest User

Untitled

a guest
Apr 20th, 2013
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.09 KB | None | 0 0
  1. package javagame;
  2.  
  3. import java.io.File;
  4. import java.net.URL;
  5. import java.net.URLDecoder;
  6.  
  7. import org.newdawn.slick.Image;
  8. import org.newdawn.slick.particles.ConfigurableEmitter;
  9. import org.newdawn.slick.particles.ParticleIO;
  10. import org.newdawn.slick.particles.ParticleSystem;
  11.  
  12. public class Particle {
  13.  
  14.     public ParticleSystem system;
  15.     public ConfigurableEmitter emitter;
  16.     Image particleImage;
  17.     String path;
  18.     URL xmlFile;
  19.     File file;
  20.  
  21.  
  22.     int angle;
  23.     public Particle(String path,float x,float y){
  24.        
  25.  
  26.         try {
  27.             particleImage = new Image("res/particles/particle.png", false);
  28.             system = new ParticleSystem(particleImage,1500);
  29.            
  30.             //load the xml file and add the emitter to the system
  31.             File xmlFile = new File("res/particles/bloodDown.xml");
  32.             ConfigurableEmitter emitter = ParticleIO.loadEmitter(xmlFile);
  33.             emitter.setPosition(315, 358);
  34.             system.addEmitter(emitter);
  35.         } catch (Exception e) {
  36.             System.out.println("Exception: " +e.getMessage());
  37.             e.printStackTrace();
  38.             System.exit(0);
  39.         }
  40.  
  41.         system.setBlendingMode(ParticleSystem.BLEND_ADDITIVE); 
  42.        
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement