xxxxxxxxxx
127
let colorx,
colory,
colorz,
facex,
facey,
eyex,
eyey,
eyeballx1,
eyeballx2,
eyeballx3,
eyeballx4,
eyebally1,
eyebally2,
nx,
ny;
function setup() {
createCanvas(400, 400);
colorMode(RGB);
colorx = 71;
colory = 148;
colorz = 101;
facex = width / 2;
facey = height / 2 - 20;
eyex1 = facex - 50;
eyex2 = eyex1 + width / 4;
eyey1 = facey;
eyey2 = eyey1 + 1;
eyeballx1 = eyex1 - 5;
eyeballx2 = eyex2 + 5;
eyebally1 = eyey1 - 8;
eyeballx3 = eyeballx1 + 15;
eyeballx4 = eyeballx2 - 15;
eyebally2 = eyebally1 + 9;
nx=140
ny=310
}
function mouseClicked() {
if (colorx < 255) {
colorx += 30;
if (colorx >= 255) {
colorx = 1;
}
}
}
function draw() {
background(210);
strokeWeight(1)
//neck
noStroke();
fill(colorx, colory, colorz);
rect(160, 270, 80, 80);
quad(120, 310, 280, 310, 340, 400, 60, 400);
//face
noStroke();
fill(255, 203, 163);
ellipse(facex, facey, 190, 240);
//hair
fill(0);
stroke(1);
rect(105, 120, 10, 80);
rect(295, 120, -10, 80);
curve(400, 600, 105, 120, 295, 120, 20, 600);
curve(400, -100, 105, 120, 295, 120, 20, 20);
//eye
stroke(0.1);
fill(255);
arc(eyex1, eyey1, 60, 55, PI + 100, -100, OPEN);
arc(eyex2, eyey1, 60, 55, PI + 100, -100, OPEN);
fill(0);
arc(eyex1, eyey2, 35, 35, PI - 25.6, 25.6, OPEN);
arc(eyex2, eyey2, 35, 35, PI - 25.6, 25.6, OPEN);
fill(255, 203, 163);
noStroke();
arc(eyex1, 207.45, 60, 40.3, +9.85, PI - 9.85, OPEN);
arc(eyex2, 207.45, 60, 40.3, +9.85, PI - 9.85, OPEN);
//eyeballs
noStroke();
fill(255);
circle(eyeballx1, eyebally1, 7);
circle(eyeballx2, eyebally1, 7);
circle(eyeballx3, eyebally2, 11);
circle(eyeballx4, eyebally2, 11);
//nose
fill(239, 160, 118);
quad(190, 190, 210, 190, 215, 225, 185, 225);
fill(0);
triangle(202, 225, 212, 225, 208, 220);
triangle(188, 225, 198, 225, 193, 220);
stroke(177, 117, 85);
strokeWeight(5);
line(200, 197, 200, 220);
//mouse
fill(205, 73, 73);
stroke(145, 38, 38);
strokeWeight(5);
curve(100, 180, 170, 260, 230, 260, 280, 110);
curve(100, 400, 170, 260, 230, 260, 280, 280);
//necklace
noStroke();
fill(240);
circle(140, 310, 7);
circle(145, 315, 7);
circle(150, 320, 7);
circle(155, 325, 7);
circle(160, 330, 7);
circle(165, 335, 7);
circle(170, 340, 7);
circle(175, 345, 7);
circle(180, 350, 7);
circle(185, 355, 7);
circle(190, 355, 7);
circle(195, 355, 7);
circle(260, 310, 7);
circle(255, 315, 7);
circle(250, 320, 7);
circle(245, 325, 7);
circle(240, 330, 7);
circle(235, 335, 7);
circle(230, 340, 7);
circle(225, 345, 7);
circle(220, 350, 7);
circle(215, 355, 7);
circle(210, 355, 7);
circle(205, 355, 7);
circle(200, 355, 7);
}