xxxxxxxxxx
54
var boolDoRefresh;
function setup() {
createCanvas(500, 500);
boolDoRefresh = true;
}
function draw() {
if (boolDoRefresh) {
background("royalBlue");
noStroke();
fill("pink");
textFont('cursive');
textSize(25);
textAlign(CENTER);
text("I Love You in So Many Ways", 250, 40);
textAlign(RIGHT);
text("Love, Sweet Corn", 450, 480);
for(let i=60; i<460; i+=50)
{
for(let j=60; j<460; j+=50)
{
if(random(0,50) > 2)
{
strokeWeight(5);
stroke("pink");
fill("white");
square(i,j,40);
}
else
{
fill("pink");
noStroke();
beginShape();
vertex(i+20, j+15);
bezierVertex(i+10, j, i-5, j+20, i+20, j+35);
vertex(i+20, j+15);
bezierVertex(i+30, j, i+45, j+20, i+20, j+35);
endShape();
}
}
}
boolDoRefresh = false;
}
}
function mousePressed() {
boolDoRefresh = true;
}