/*Jennifer DeLuna
SectionB
jdeluna@andrew.cmu.edu
project-02*/
//defined variables
var eyeSize = 20;
var faceWidth = 300;
var faceHeight = 270;
var skinC1 = 60;
var skinC2 = 200;
var skinC3 = 180;
var toothH=10
var toothW=10
function setup() {
createCanvas(640, 480);
}
function draw() {
background (162, 232, 232);
//face
fill(skinC3, skinC2, skinC1)
ellipse(width/2, height/2, faceWidth*1.3, faceHeight*1.3)
fill(skinC2, skinC3, skinC1)
ellipse(width/2, height/2, faceWidth*1.2, faceHeight*1.2)
fill(skinC1, skinC3, skinC2)
ellipse(width/2, height/2, faceWidth*1.1, faceHeight*1.1)
fill(skinC1, skinC2, skinC3);
noStroke();
ellipse(width/2, height/2, faceWidth, faceHeight);
//mouth
fill(0)
rect(width/2-15, height/2 +30, 30,45,7)
fill(255)
rect(width/2,height/2 +30,toothW, toothH,2)
fill(237, 116, 116)
rect(width/2-15,height/2+ 65,30,10,5);
//eyes
var eyeL = width / 2 - faceWidth * 0.25;
var eyeR = width / 2 + faceWidth * 0.25;
fill(0)
noStroke()
ellipse(eyeL, height / 2, eyeSize, eyeSize);
ellipse(eyeR, height / 2, eyeSize, eyeSize);
}
function mousePressed() {
faceWidth = random(260, 350);
faceHeight = random(230, 300);
eyeSize = random(10, 30);
skinC1 = random(0, 255);
skinC2 = random(0, 255);
skinC3 = random(0, 255);
toothH=random(5,15);
toothW=random(8,11)
}