class Ball { float x; float y; float w; float speed; Ball(float x_, float y_, float w_) { x = x_; y = y_; w = w_; speed = 0; } void gravity() { //add gravity to speed speed = speed + gravity; } void move() { //add speed to y location y = y + speed; //if square reaches bottom, reverse speed if (y > height) { speed = speed * -0.95; y = height; } } void display() { //dispaly circle fill (255); noStroke(); ellipse(x, y, w, w); } }