class Ball{ color c; float x; float y; float diam; float speed = 0; float gravity = 0.5; Ball(color tempC, float tempXpos, float tempYpos){ c = tempC; x = tempXpos; y = tempYpos; } void display(){ stroke(0); fill(c); ellipseMode(CENTER); ellipse(x,y,15,15); } void move(){ y = y + speed; speed = speed + gravity; if (y > height){ speed = speed * -0.95; } } }