xxxxxxxxxx
91
let faceColor;
let eyeColor;
let mouthSize;
let xPos;
let yPos;
function setup() {
createCanvas(400, 400);
//defining variables
faceColor = color(252, 215, 159);
eyeColor = color(0);
mouthSize = 50;
xPos = width/2;
yPos = height/2;
}
function draw() {
background('pink');
//back hair
noStroke();
fill(66, 37, 37);
rect(99, 67, 207, 297, 100);
//face
fill(faceColor);
stroke(0,0,0);
ellipse(200,170,150,175);
//eyes
fill(255, 255, 255);
//white
ellipse(164,146,44,40);
ellipse(235,146,44,40);
//eyebrows
strokeWeight(2);
arc(151,117,43,-13,0,176);
arc(226,117,43,-13,0,176);
strokeWeight(2);
//blush
noStroke();
fill(235, 141, 141);
ellipse(154,187,34,21);
ellipse(247,187,34,21);
//pupils
fill(0, 0, 0); //black
ellipse(164,145,25,25);
ellipse(235,145,25,25);
fill(255, 255, 255);
noStroke();
ellipse(173,140,15,15);
ellipse(244,140,15,15);
//glasses
noFill();
stroke(0, 0, 0);
strokeWeight(5);
ellipse(162,145,59,53);
ellipse(235,145,59,53);
line(192,143,204,142);
strokeWeight(1);
//nose
triangle(200,180,200,190,215,180);
//shirt
noStroke();
fill(51, 43, 43);
rect(200,297,70,101);
ellipse(199,349,236,185);
//mouth
arc(xPos, yPos + 20, mouthSize, mouthSize, 0, PI);
}
//widen the mouth
function mouseDragged() {
mouthSize = constrain(dist(mouseX, mouseY, xPos, yPos), 20, 70);
}