Project 01-Face

this is my project

sketch
//Aarnav Patel
//Section D

function setup() {
    createCanvas(500, 500);
    background(220);
}
var pos = (500 / 7 / 2);

function draw() {
	var randomR = random(1, 256);
	var randomG = random(1, 256);
	var randomB = random(1, 256);
	if (mouseIsPressed) {
	    background(randomR, randomG, randomB);
	}
	//body
	fill(255);
	ellipse(width / 2, height, width / 1.5, height);
	//face
	noStroke();
	fill(221, 161, 119);
	ellipse((width / 2), (height / 2), (width / 3),  (width / 2));


	//hair
	fill(0);
	ellipse((width / 2), ((height / 2) - (width / 3 / 2)), (width / 3), (width / 4));
	rect((width / 2) - ((width / 3 / 2)) - 10, ((height / 2) - 50), 20, 50);
	rect((width / 2) + ((width / 3 / 2)) - 10, ((height / 2) - 50), 20, 50)
	triangle((width / 2) - ((width / 3 / 2)) - 10, ((height / 2) - 50), (width / 2) - ((width / 3) / 2), ((height / 2) - (width / 3 / 2)), (width / 2) + ((width / 3 / 2)) + 10, ((height / 2) - 50));
	triangle((width / 2) - ((width / 3 / 2)) - 10, ((height / 2) - 50), (width / 2) + ((width / 3) / 2), ((height / 2) - (width / 3 / 2)), (width / 2) + ((width / 3 / 2)) + 10, ((height / 2) - 50));

	//eyes
	ellipse((width / 2) - ((width / 3) / 4), (height / 2), 10);
	ellipse((width / 2) + ((width / 3) / 4), (height / 2), 10);

	//nose
	fill(170, 130, 100);
	ellipse((width / 2), (height / 2) + 50, 50);
	fill(221, 161, 119);
	ellipse((width / 2), (height / 2) + 40, 50);

	//smile
	fill(0);
	rect((width / 2) - ((width / 10) / 2), (height / 2) + 100, (width / 10), 3);


 
}

Leave a Reply