class Ball { float x; float y; float speedX, speedY; float r, g, b; Ball(){ x = 30; y = 30; speedX = 1; speedY = 2; r = 10; g = 125; b = 15; } Ball(float x_, float y_){ x = x_; y = y_; speedX = 2; speedY = 2; r = 10; g = 67; b = 175; } Ball(float x_, float y_, int r_, int g_, int b_){ x = x_; y = y_; speedX = 1; speedY = 2; r = r_; g = g_; b = b_; } void move(){ x = x + speedX; y = y + speedY; } void bounce(){ if ((x > width) || (x < 1)) { speedX = speedX * - 1; } if ((y > width) || (y < 0)) { speedY = speedY * - 1; } } void display(){ stroke(100,25,75); fill(111,10,5); ellipse(x,y,32,32); } }