Christine Kim – Project -02

sketch

//Christine Kim
//Section A (Tuesdays 9:00)
//haewannk@andrew.cmu.edu
//Project-02

var eyeWidth = 13;
var eyeHeight = 15;
var faceWidth = 130;
var faceHeight = 150;
var noseWidth = 7
var noseHeight = 10
var eyebrowsWidth = 10
var eyebrowsHeight = 3 
var mouthWidth = 13
var mouthHeight = 5
var cheekWidth = 15;
var cheekHeight = 5;
 
function setup() {
    createCanvas(640, 480);
}
 
function draw() {
    background(198,234,162);
    noStroke();
    fill(241,212,177);
    
    //face
    ellipse(width / 2, height / 2, faceWidth,  faceHeight);
    
    //eyes
    fill(73,45,37);
    ellipse(287,220, eyeWidth, eyeHeight);
    ellipse(355,220, eyeWidth, eyeHeight);

    //nose
    fill(186,155,129);
    ellipse(width/2,height/2,noseWidth,noseHeight);

    //eyebrows
    fill(86,47,44);
    ellipse(288,200,eyebrowsWidth,eyebrowsHeight);
    ellipse(353,200,eyebrowsWidth,eyebrowsHeight);

    //mouth
    fill(198,59,24);
    ellipse(width/2,280,mouthWidth,mouthHeight);

    //cheek
    fill(229,142,195);
    ellipse(280,240,cheekWidth,cheekHeight);
    ellipse(360,240,cheekWidth,cheekHeight);
}
 
function mousePressed() {
    // when the user clicks, these variables are reassigned
    // to random values within specified ranges. For example,
    // 'faceWidth' gets a random value between 75 and 150.
    faceWidth = random(75, 150);
    faceHeight = random(100, 200);
    eyeWidth = random(7, 20);
    eyeHeight = random(5,20)
    noseWidth = random(5,20);
    noseHeight = random(7,30);
    eyebrowsWidth = random(7,20);
    eyebrowsHeight = random(3,8);
    mouthWidth = random(5,20);
    mouthHeight = random(2,15);
    cheekWidth = random(5,20);
    cheekHeight = random(3,8);
}

Leave a Reply