xxxxxxxxxx
33
function setup() {
createCanvas(windowWidth, windowHeight);
noLoop();
//frameRate(4); // slowing down how frequently the draw function reloads
}
function draw() {
background(140, 140, 255);
// here, I'm calling the daisy() function three times, with three different parameters
//daisy(60, 100);
//daisy(mouseX, mouseY);
for (let i = 0; i < 10; i++) {
daisy(random(width), random(height));
}
}
function daisy(dX, dY) {
fill(255);
ellipse(dX + 10, dY, 15, 10);
ellipse(dX - 10, dY, 15, 10);
ellipse(dX, dY + 10, 10, 15);
ellipse(dX, dY - 10, 10, 15);
fill(255,255,0);
ellipse(dX, dY, 10, 10);
}