class Particle { Vector3D loc; Vector3D vel; Vector3D acc; float r; // size float timer; //timespan Particle(Vector3D loc_, Vector3D vel_, Vector3D acc_, float r_) { loc = loc_.copy(); vel = vel_.copy(); acc = acc_.copy(); r = r_; timer = 50.0; } void run() { update(); timer(); render(); } // particle update location method void update() { vel.add(acc); loc.add(vel); } void timer() { timer -= 1.0; } void render() { ellipseMode(CENTER); noStroke(); fill(255,timer*2); ellipse(loc.x, loc.y, r,r); } boolean dead() { if(timer <= 0.0) { return true; } else { return false; } } }