xxxxxxxxxx
41
let im, im2, paw, heart;
let cx, cy = [];
function preload() {
paw = loadImage("Untitled200.png");
heart = loadImage("black-heart_1f5a4.png");
// from: https://pin.it/4z09Xlz & https://emojipedia.org/black-heart/
}
function setup() {
createCanvas(400, 400);
im2 = createGraphics(400, 400);
im2.background(128);
im2.imageMode(CENTER);
im2.image(heart, 200, 200, 200, 200);
cx = [7, 17, 29, 41, 51];
cy = [-50, -40, -25, -10, 25];
createLoop({
duration: 5,
gif: {
download: true,
}
})
}
function draw() {
background(128);
if (mouseIsPressed) {
im2.stroke(255);
im2.strokeWeight(25);
im2.noFill();
im2.strokeWeight(3);
im2.stroke(255, 50, 0);
for (let i = 0; i < cx.length; i++)
im2.line(pmouseX + cx[i], pmouseY + cy[i], mouseX + cx[i], mouseY + cy[i]);
}
imageMode(CORNER);
image(im2, 0, 0, width, height);
imageMode(CENTER);
image(paw, mouseX, mouseY, 100, 100);
}