Ball ball; Ball blueBall; Ball greenBall; void setup() { size(200, 200); smooth(); ball = new Ball(); ball.x = random(width); ball.y = random(height); ball.s = random(20, 50); ball.col = color(255, 0, 0); blueBall = new Ball(); blueBall.x = random(width); blueBall.y = random(height); blueBall.s = random(20, 50); blueBall.col = color(0, 0, 255); greenBall = new Ball(); greenBall.x = random(width); greenBall.y = random(height); greenBall.s = random(20, 50); greenBall.col = color(0, 255, 0); } void draw() { background(220); ball.x = mouseX; ball.y = mouseY; ball.drawShape(); blueBall.drawShape(); greenBall.drawShape(); } class Ball { // Eigenschaften float x; float y; color col; float s; // Methode void drawShape() { fill(col); ellipse(x, y, s, s); } }