Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javagame;
- import java.util.ArrayList;
- import org.newdawn.slick.particles.ConfigurableEmitter;
- import org.newdawn.slick.particles.ParticleSystem;
- public class ParticleManager {
- public ParticleSystem system;
- public ConfigurableEmitter emitter;
- ArrayList<Particle> particleList = new ArrayList<Particle>();
- String down="res/particles/bloodDown.xml";
- String up="res/particles/bloodUp.xml";
- String left="res/particles/bloodLeft.xml";
- String right="res/particles/bloodRight.xml";
- public ParticleManager(){
- }
- public void update(int delta){
- for (Particle o: particleList) {
- if(o.emitter.completed() == true){
- particleList.remove(o);
- }
- else{
- o.system.update(delta);
- }
- }
- }
- public void bloodDown(float x, float y){
- Particle a= new Particle(down,x,y);
- particleList.add(a);
- // loop troguh and call update
- }
- public void bloodUp(float x, float y){
- Particle a= new Particle(up,x,y);
- particleList.add(a);
- // loop troguh and call update
- }
- public void bloodLeft(float x, float y){
- Particle a= new Particle(left,x,y);
- particleList.add(a);
- // loop troguh and call update
- }
- public void bloodRight(float x, float y){
- Particle a= new Particle(right,x,y);
- particleList.add(a);
- // loop troguh and call update
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement