void setup() { size(400,400); smooth(); frameRate(15); background(0); } void draw() { fadeAway(); // move the execution to the function drawRandomL(); // move the execution to the function } // Paint a transparent black rectangle over window void fadeAway() { fill(0,20); rect(0,0,width,height); } // draw random L shape void drawRandomL() { fill(random(128,255),random(128,255),random(128,255)); drawL(random(width),random(height),random(50,150)); } // Draw a L shape at the given position and of a given size void drawL(float x, float y, float s) { beginShape(); vertex(x,y); vertex(x,y+s); vertex(x+s,y+s); vertex(x+s,y+s/2); vertex(x+s/2,y+s/2); vertex(x+s/2,y); endShape(CLOSE); } // START NO NOTES // code used to capture screenshots void keyReleased() { if(key == '`' && !online) save("sketch.png"); }