Project 2 – Variable Face

click the clown man

sketch
//Se A Kim, Section D

var noseWidth = 100;
var noseHeight= 100;
var eyeheight = 250;
var eyeSize = 20;
var bodywidth = 500;
var bodyheight = 500;
var mouthheight = 100;
var mouthwidth = 100;



function setup() {
    createCanvas(600, 600);
    background(219, 246, 247);

}

function draw() {

noStroke();
frameRate(5);
fill(random(0,255), random(0,255), random(0,255));
ellipse(300, 300, 400, 400);
ellipse(400, 400, 300, 300);
ellipse(100,500,400,400);
ellipse(500,500,400,400)

noStroke();
fill(255, 255, 255);    //body
ellipse(300, 600, bodywidth, bodyheight);

fill(255, 0, 0);
triangle(280, 600, 300, 300, 350, 600);

fill(255,218,185)   //face
ellipse (300, 300, 300, 300);

frameRate(2);
fill(random(0,255), random(0,255), random(0,255));
arc(300, 330, mouthwidth, mouthheight, 0, 600);    //mouth

 //eye
ellipse(250, eyeheight, eyeSize);
ellipse(350, eyeheight, eyeSize);

noStroke(); //nose
fill(255,0, 0);
ellipse(300, 300, noseWidth, noseHeight);


}

function mousePressed(){

    noseWidth = random (50, 100);
    noseHeight = random (50, 100);
    eyeSize = random (20, 50);
    bodywidth = random(200, 500);
    bodyheight = random(300, 500);
    mouthwidth = random(100,200);
    mouthheight = random(100,200);
    eyeheight = random(230, 270);


   
}

Leave a Reply