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) { pushMatrix(); translate(x,y); beginShape(); vertex(0,0); vertex(0,s); vertex(s,s); vertex(s,s/2); vertex(s/2,s/2); vertex(s/2,0); endShape(CLOSE); popMatrix(); } // START NO NOTES // code used to capture screenshots void keyReleased() { if(key == '`' && !online) save("sketch.png"); }