xxxxxxxxxx
47
function setup() {
createCanvas(450, 450);
}
function draw() {
background('#266138');
noStroke()
//eyewhites
for (let x=0; x<=width; x+=100) {
for (y=0; y<= height; y+=50) {
fill('rgb(206,220,224)')
ellipse (x,y,80,35);
strokeWeight(3);
stroke('pink');
}
}
//pupils when eyes are closed
noStroke()
for (let x=0; x<=width; x+=200) {
for (y=0; y<= height; y+=50) {
if (mouseIsPressed){
fill('#FFBB00');
circle (x+90,y,25)
}
// pupils when eyes are open
else{
fill('#2D96BC')
circle (x+100,y,25)
}
fill('#2D96BC')
circle (x, y, 25)
}
//eyelids when eyes are closed
for (let x=0; x<=width; x+=200) {
for (y=0; y<= height; y+=50) {
if (mouseIsPressed){
fill ('pink')
ellipse (x,y,80,35);
fill ('rgb(250,131,152)')
arc (x,y,80,35, PI, 0);
}
}
}
}
}