// Horizontale Position float x = 0; // Vertikale Position float y = 0; // Horizontale Geschwindigkeit float vx = 4; // Vertikale Geschwindigkeit float vy = 4; // Größe des Kreises float s = 36; void setup() { size(600, 400); smooth(); fill(200); noStroke(); // Ball in die Mitte setzen x = width/2; y = height/2; } void draw() { background(100); // Zeichne Kreis ellipse(x, y, s, s); // Verändere Position x = x + vx; y = y + vy; // Wenn Ball am rechten oder linken Rand if (x >= width || x <= 0) { vx = -vx; } // Wenn Ball am unteren oder oberen Rand if (y >= height || y <= 0) { vy = -vy; } }