// stephanieaaron@mac.com float direction = 1; float speed = 0; float y = 0; void setup() { size(200, 200); background(0); smooth(); } void draw() { background(0); //start moving y = y + (direction * speed); if (y>190) { y=190;} if (direction ==1) { speed = speed + 0.1;} else if (direction == -1) { speed = speed - 0.1; } //change direction if (y>=190){ direction = -1; speed = speed - .3; } if (y<=0 || speed <= 0){ direction = 1; } println(speed); // here's a box noStroke (); fill(#FFFFFF); // white rect(90, y, 10, 10); // bouncy }