xxxxxxxxxx
35
function heart(x0, y0, w) {
let xRadius = w / 2;
let ellipseDiam = xRadius * 1.25;
let ellipseOffsetX = (2 / 9) * w;
let ellipseOffsetY = (3 / 20) * w;
let triY = 1.2 * xRadius;
ellipse(x0 - ellipseOffsetX, y0 - ellipseOffsetY, ellipseDiam);
ellipse(x0 + ellipseOffsetX, y0 - ellipseOffsetY, ellipseDiam);
triangle(x0 - xRadius, y0, x0 + xRadius, y0, x0, y0 + triY);
}
function setup() {
createCanvas(windowWidth, windowHeight);
noLoop();
}
function draw() {
background(220, 10, 120);
fill(250, 190, 0);
noStroke();
heart(200, 150, 240);
heart(200, 350, 40);
heart(80, 300, 80);
heart(320, 300, 80);
heart(40, 200, 40);
heart(360, 200, 40);
heart(30, 100, 20);
heart(370, 100, 20);
}