// Dartmouth CS 2, Winter 2009, Chris Bailey-Kellogg // Notes 14 | Sketch 2 // Based on R&F 50-16 // Two connected springs Spring spring1, spring2; void setup() { size(100,100); smooth(); background(0); strokeWeight(3); spring1 = new Spring(width/2,height/2); spring2 = new Spring(width/2,height/2); } void draw() { background(0); spring1.draw(); spring2.draw(); // Recenter spring1 at the mouse spring1.update(mouseX,mouseY); // Recenter spring2 at spring1 spring2.update(spring1.x,spring1.y); }