Hyejo Seo-Project-02-Variable-Face

sketch

/*
Hyejo Seo
Section A
hyejos@andrew.cmu.edu
Project-02-Variable-Face
*/


var faceW = 300;
var faceH = 250;
var eyeH = 150;
var eyeW = 110;
var ex1 = 190;
var ex2 = 290;
var r = 240; 
var g = 72;
var b = 75; 


function setup() {
    createCanvas(480,640);
    
}

function draw() {
    background(47, 50, 47);
    //face
    fill(r, g, b);
    noStroke();
    ellipse(240, 530, faceW, faceH);
    // eyes
    fill(255);
    noStroke();
    ellipse(300, 520, eyeW, eyeH);
    ellipse(180, 520, eyeW, eyeH);
    // pupils
    fill(0);
    ellipse (295, 470, eyeW/2 - 20, eyeH/2 - 40);
    ellipse (185, 470, eyeW/2 - 20, eyeH/2 - 40);
    //exclamation mark
    noFill();
    stroke(221, 249, 193);
    strokeWeight(10);
    quad(ex1, 100, ex2, 100, 245, 250, 235, 250);
    circle(240, 320, 50);
}

function mousePressed() {
    faceW = random(150, 400);
    faceH = random(150, 300);
    eyeW = random(90, 130);
    g = random(0, 80);
    b = random(0, 100);
    ex1 = random(100, 190);
    ex2 = random(290,380);
    
}

Are you forgetting something? 

Oh, yes! 

Leave a Reply