Judy Li-Project-01-Face

judyli:Face Project

/*
Judy Li
Section A
judyli@andrew.cmu.edu
Assignment-01
*/

function setup() {
    createCanvas(500, 500);
    background(218,165,32);
}

function draw() {
	drawBackgroun();
	drawFace();
	drawBrows();
	drawEyes();
	drawLashes();
	drawNose();
	drawMouth();
	drawHat();
}

function drawBackgroun() {
	strokeWeight(0);
	fill(218,175,32);
	rect(50,50,400,400);
	fill(218,165,32);
	rect(100,100,300,300);
	fill(218,175,32);
	rect(150,150,200,200);

}

function drawFace() {
	strokeWeight(0);
	fill(239,219,178);
	rect(200,225,100,50);
	ellipseMode(CENTER);
	ellipse(250,225,100,50);
	ellipse(250,280,100,75);
}

function drawBrows() {
	fill(77,55,39);
	ellipse(225,240,30,5);
	ellipse(275,240,30,5);
	fill(239,219,178);
	ellipse(225,242.5,30,3);
	ellipse(275,242.5,30,3);
}

function drawEyes() {
	fill(239,200,150);
	ellipseMode(CENTER);
	ellipse(225,250,25,10);
	ellipse(275,250,25,10);
}

function drawLashes() {
	strokeWeight(1);
	line(225,255,225,257.5);
	line(220,255,217.5,257.5);
	line(230,255,232.5,257.5); 
	line(275,255,275,257.5);
	line(270,255,267.5,257.5); 
	line(280,255,282.5,257.5); 
}

function drawNose() {
	strokeWeight(0.5);
	fill(239,200,150);
	ellipse(248,280,10,5);
}

function drawMouth() {
	strokeWeight(0);
	fill(230,141,139);
	ellipse(245,298,10,5);
	ellipse(255,298,10,5);
	fill(225,120,118);
	ellipse(250,300,20,2.5);
	ellipse(250,300.5,17.5,4.5);
}

function drawHat() {
	strokeWeight(0);
	fill(108,108,108);
	rect(200,215,100,5);
	fill(0,0,0);
	rect(200,215,100,-30);
	ellipse(250,185,100,25);
	ellipse(250,225,185,15);
}

A lot of the people around me tell me that I love to sleep, wear hats quite often, and love the color golden yellow. Hence, I used all that for this project. When I started out, it was a bit difficult to start because I had no image in mind. But, I started to play around with the shapes and color to created this. I think during this process, I realized that my java script codes were a bit messy, so I made it more organized and I think that helped me a lot! Overall, I had fun with this project and learned a lot.

Leave a Reply