PSystem ps; Particle a, b, c, d; void setup() { size(400,400); ps = (PSystem)loadPlugin("PSystem"); a = new Particle(width/2 - 50, 0, 0); a.fix(); ps.addParticle(a); b = new Particle(width/2 + 50, 0, 0); ps.addParticle(b); c = new Particle(width/2, 70, 0); ps.addParticle(c); d = new Particle(width/2, 70, 0); ps.addParticle(d); ps.addSpring(a, b); ps.addSpring(b, c); ps.addSpring(c, d); ps.addSpring(d, a); b.fix(0, 30); d.fix(1, 30); ps.drawForces = false; } void loop() { a.setPos(mouseX, mouseY, 0); background(255); stroke(100, 100, 100, 100); line(30, 0, 30, height); line(0, 30, width, 30); stroke(200, 100, 100, 150); fill(255, 0, 0); ps.draw(); }