import java.awt.Rectangle; // a particle with an ID, also a "goal" it moves to. // The velocity manipulation allows the particle to neatly get somewhere public class IDParticle extends Particle { public int id = -1; int xgoal, ygoal; public long lastTime; public final static boolean slideToGoal = false; public float hue; public IDParticle(Rectangle r, double ix, double iy, double ivx, double ivy, double iax, double iay, int n) { super(r, ix, iy, ivx, ivy, iax, iay); id = n; } public void setGoal(int newX, int newY) { xgoal = newX; ygoal = newY; vx = (xgoal - x) / 10; vy = (ygoal - y) / 10; } public void setTime(long t) { lastTime = t; } public void setHue(float h) { hue = h; } public void step(double t) { super.step(t); vx = (xgoal - x) / 6; vy = (ygoal - y) / 6; } }