Advertisement
Guest User

Untitled

a guest
Apr 17th, 2013
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.36 KB | None | 0 0
  1. package javagame;
  2.  
  3. import java.util.ArrayList;
  4. import org.newdawn.slick.particles.ConfigurableEmitter;
  5. import org.newdawn.slick.particles.ParticleSystem;
  6.  
  7. public class ParticleManager {
  8.    
  9.     public ParticleSystem system;
  10.     public ConfigurableEmitter emitter;
  11.     ArrayList<Particle> particleList = new ArrayList<Particle>();
  12.    
  13.     String down="res/particles/bloodDown.xml";
  14.     String up="res/particles/bloodUp.xml";
  15.     String left="res/particles/bloodLeft.xml";
  16.     String right="res/particles/bloodRight.xml";
  17.    
  18.     public ParticleManager(){
  19.     }
  20.    
  21.     public void update(int delta){
  22.        
  23.         for (Particle o: particleList) {
  24.             if(o.emitter.completed() == true){
  25.                 particleList.remove(o);
  26.             }
  27.             else{
  28.                 o.system.update(delta);
  29.             }
  30.  
  31.         }
  32.     }
  33.    
  34.     public void bloodDown(float x, float y){
  35.        
  36.         Particle a= new Particle(down,x,y);
  37.         particleList.add(a);
  38.         // loop troguh and call update
  39.        
  40.     }
  41.    
  42.     public void bloodUp(float x, float y){
  43.        
  44.         Particle a= new Particle(up,x,y);
  45.         particleList.add(a);
  46.         // loop troguh and call update
  47.        
  48.     }
  49.    
  50.     public void bloodLeft(float x, float y){
  51.        
  52.         Particle a= new Particle(left,x,y);
  53.         particleList.add(a);
  54.         // loop troguh and call update
  55.        
  56.     }
  57.    
  58.     public void bloodRight(float x, float y){
  59.        
  60.         Particle a= new Particle(right,x,y);
  61.         particleList.add(a);
  62.         // loop troguh and call update
  63.        
  64.     }
  65.  
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement