float s = 100; void setup() { size(400, 400); smooth(); background(255); } void draw() { // Zufällige Farbe, deren Transparenz abhängig von der // horizontalen Mausposition ist fill(255, random(100, 255), random(100, 255), mouseX); stroke(0, mouseX * 2); // Größe des Elements abh. von Tastendruck if (keyPressed) { if (key == 's') { s = 20; } if (key == 'm') { s = 60; } if (key == 'l') { s = 100; } } if (mousePressed) { rect(random(width), random(height), s, s); } else { ellipse(random(width), random(height), s, s); } }