xxxxxxxxxx
41
function setup() {
createCanvas(400, 400);
}
function draw() {
//background(240);
drawEmoji(20, 20, 100, 100);
drawEmoji(100, 100, 100, 100);
drawEmoji(100, 300, 100, 100);
drawEmoji(200, 200, 100, 100);
drawEmoji(mouseX, mouseY, 100, 100);
}
function drawEmoji(x, y, width, height)
{
// Body
stroke(222, 192, 40);
strokeWeight(2);
fill(255, 221, 51);
ellipse(x, y, 120, 120);
// Left Eye
strokeWeight(0);
fill(122, 91, 58);
ellipse(x-20, y-15, 15, 25);
// Right Eye
strokeWeight(0);
fill(122, 91, 58);
ellipse(x+20, y-15, 15, 25);
// Mouth
strokeWeight(6);
stroke(122, 91, 58);
line(x-30, y+20, x+30, y+20);
}