xxxxxxxxxx
42
let eye_color;
function setup() {
createCanvas(400, 400);
background(220);
}
function draw() {
//print mouse location in console
print(mouseX,mouseY)
//push & pop makes command affect what it encloses
push()
fill(220,100,100)
noStroke()
//bigger ellipse for the face
ellipse(width/2,height/2,80,120)
pop()
push()
rectMode(CENTER) //change default rectangle mode to CENTER
noFill()
//drawing eyes
fill(mouseX,mouseY,20)
square(180,185,20)
square(215,185,20)
pop()
//mouth
ellipse(198,240,20,10)
}
//change background color when mouse is clicked
function mouseClicked(){
background(random(100),random(100),random(100))
}