xxxxxxxxxx
56
/*
Assignment 2: Self Portrait
*/
function setup() {
createCanvas(500, 500);
}
function mouseClicked() {
save("Assignment 1.png");
}
function draw() {
background("#c0c0c0");
noStroke(); //face
fill("#E0AC69");
ellipse(250, 250, 210, 265);
stroke("#8D5524"); //teeth
strokeWeight(4);
line(190, 320, 290, 330);
noStroke(); //eyes
fill("white");
arc(290, 230, 40, 60, -PI, PI * 2, CHORD); //outer R
arc(210, 230, 40, 60, -PI, PI * 2, CHORD); //outer L
fill("#8D5524");
arc(290, 230, 20, 40, -PI, PI * 2, CHORD); //pupil R
arc(210, 230, 20, 40, -PI, PI * 2, CHORD); //pupil L
fill("black");
arc(295, 230, 10, 15, -PI, PI * 2, CHORD); //pupil R
arc(215, 230, 10, 15, -PI, PI * 2, CHORD); //pupil L
fill("#E0AC69");
arc(350, 230, 50, 50, -PI / 2, PI / 2); //center R
arc(150, 230, 50, 50, PI / 2, -PI / 2); //center L
stroke("#8D5524"); //nose
strokeWeight(4);
fill("#E0AC69");
triangle(240, 275, 250, 250, 260, 275);
fill("white"); //hat
stroke("black");
strokeWeight(8);
arc(250, 180, 195, 170, -PI, PI * 2, CHORD);
fill("black"); //hat bill
noStroke();
arc(250, 180, 195, 60, -PI, PI * 2, CHORD);
}