xxxxxxxxxx
47
let r = 0;
function setup() {
createCanvas(400, 400);
angleMode(DEGREES); // setting angle mode to degrees
}
function draw() {
//background(220);
doubleLeaf(random(width), random(height));
}
function leaf(leafX, leafY) {
fill(136, 179, 145);
ellipse(leafX, leafY, 50, 100);
line(200, 250, 200, 305)
line(200, 250, 200, 150);
line(200, 200, 180, 170);
line(200, 200, 220, 170);
}
function doubleLeaf(doubleLeafX, doubleLeafY){
push();
translate(width/2, height/2);
rotate(15);
leaf(10, 0);
pop();
leaf(doubleLeafX,doubleLeafY);
leaf(200, 200);
leaf(300, 300);
leaf(400, 400);
leaf(100, 100);
}