int acounter = 0; void setup() { size(400,400); background(255); } void draw() { fill(acounter%255); if (acounter%2 == 0) { drawLessCrazyShape(acounter%width,acounter%height,60); } else { drawCrazyShape(width-(acounter%width),height-(acounter%height)); } acounter++; } void mousePressed() { fill(mouseX,0,mouseY); drawCrazyShape(mouseX, mouseY); } void mouseDragged() { fill(255,0,0); drawLessCrazyShape(mouseX,mouseY,50); } void drawCrazyShape(int x, int y) { beginShape(POLYGON); vertex(x, y); x = x/(y+1)*2; vertex(x, y); y++; x--; vertex(x, y); y = x/(y+1)*2; vertex(x, y); x -= 30; vertex(x, y); vertex(y*2, x); endShape(); } void drawLessCrazyShape(int one, int two, int size) { beginShape(POLYGON); vertex(one, two); one -= size; two += size; vertex(one, two); one -= size; two -= size; vertex(one, two); one += size; two -= size; vertex(one, two); one -= size; two += size; vertex(one, two); endShape(); }