float theta = 0; float delta = 0.05; void setup() { size(400, 400); frameRate(30); smooth(); } void draw() { background(255); translate(mouseX, mouseY); rotate(theta); rectMode(CENTER); noStroke(); fill(240, 32, 32); rect(0, 0, 90, 90); fill(240, 128, 128); rect(120, 0, 45, 45); rect(-120, 0, 45, 45); rect(0, -120, 45, 45); rect(0, 120, 45, 45); theta += delta; }