/** * Springs. * * Move the mouse over one of the circles and click to re-position. * When you release the mouse, it will snap back into position. * Each circle has a slightly different behavior. */ int num = 3; Spring[] springs = new Spring[num]; void setup() { size(200, 200); noStroke(); smooth(); springs[0] = new Spring( 70, 160, 20, 0.98, 8.0, 0.1, springs, 0); springs[1] = new Spring(150, 110, 60, 0.95, 9.0, 0.1, springs, 1); springs[2] = new Spring( 40, 70, 120, 0.90, 9.9, 0.1, springs, 2); } void draw() { background(51); for (int i = 0; i < num; i++) { springs[i].update(); springs[i].display(); } } void mousePressed() { for (int i = 0; i < num; i++) { springs[i].pressed(); } } void mouseReleased() { for (int i=0; i