class PParticle extends PVector { PParticle() { super(); } PParticle(float _x, float _y, ParticleSystem _physics) { super(_x, _y); particle = _physics.makeParticle(1.0, x, y, 0.0); } void restart(ParticleSystem _physics) { particle.kill(); particle = _physics.makeParticle(1.0, x, y, 0.0); } void moveTo(float _x, float _y) { x = _x; y = _y; particle.moveTo(x, y, 0); } void displace(float _dx, float _dy) { x += _dx; y += _dy; particle.moveTo(x, y, 0); } void update() { x = particle.position().x(); y = particle.position().y(); } Particle particle; }