// Example OOP: Ball as a class
class Ball {
// Attributes/Properties of all Ball objects
float x, y; // location in sketch
float radius; // ball radius
color ballColor;

// Constuctors
Ball() {
x = random(width);
y = random(height);
radius = 25;
ballColor = color(0);
} // end of Ball constructor

Ball(float r) {
x = random(width);
y = random(height);
radius = r;
ballColor = color(0);
} // end of Ball constructor

// behaviors/methods
void display() {
push();
fill(ballColor);
circle(x, y, 2*radius);
pop();
} // display()

} // end of class Ball