// Draw clover leaves void setup() { // all sketch setup goes here size(400, 400); smooth(); background(0); } // setup()
void draw() { } // draw()
void mousePressed() { fill(0, random(100, 255), 0); noStroke(); flower(mouseX, mouseY, random(80, 120)); } // mousePressed()
void flower(float x, float y, float sz) { translate(x, y); clover(0, 0, sz/2);
rotate(radians(90)); clover(0, 0, sz/2);
rotate(radians(90)); clover(0, 0, sz/2);
rotate(radians(90)); clover(0, 0, sz/2); } // flower()
void clover(float x, float y, float sz) {
beginShape(); curveVertex(x, y); curveVertex(x, y); curveVertex(x+0.1*sz, y-0.5*sz); curveVertex(x+0.5*sz, y-sz); curveVertex(x+sz, y-0.5*sz); curveVertex(x+0.5*sz, y-0.1*sz); curveVertex(x, y); curveVertex(x, y); endShape(CLOSE); } // clover