/* Adam Murray, 2009 http://compusition.com */ BouncingBall[] balls = new BouncingBall[20]; float increment = 0.035; float zoff = 0.0; float zincrement = 0.01; void setup() { size(450,450); strokeWeight(2); smooth(); background(0); for(int i=0; i 0) { alpha --; return; } init(); } y += v; x += random(1.0)-0.5; v += a; if(y > height-d) { v -= random(3.0)+v/5.0; if(v < 0) { stopped = true; } v *= -1; y = height-d; } } }