//This code draws a pyramid that follows the mouse int tx, ty; void setup() { size(300, 300); background(0); smooth(); stroke(255); frameRate(8); tx = 0; ty = 0; } void mouseDragged() { tx = mouseX; ty = mouseY; } void drawP() { fill(55, 27, 232); rect(0, 0, 20, 10); fill(43, 123, 255); rect(-10, 10, 20, 10); rect(10, 10, 20, 10); } void draw() { background(0); pushMatrix(); translate(tx, ty); drawP(); popMatrix(); }