xxxxxxxxxx
55
function setup() {
// Create drawing canvas
createCanvas(400, 400);
// Dark gray background
background(120);
//body parts
Purpleface(200, 200, 150, 200);
eyes(150, 150, 70, 40);
eyebrows(130, 110, 170, 120);
Antenna(200, 125, 200, 50);
mouth(200, 250, 50, 20);
bodyandarms(150, 350, 300, 300);
}
function Purpleface(a, b, c, d) {
fill(127, 0, 127);
ellipse(a, b, c, d);
}
function eyes(e, f, g, h) {
fill(0, 200, 127);
ellipse(e, f, g, h);
ellipse(e+100, f, g-30, h+20);
fill(0);
ellipse(e+20, f, g-65, h-35);
ellipse(e+120, f, g-60, h-30);
}
function eyebrows(i, j, k, l) {
stroke(255, 100, 100);
strokeWeight(15);
line(i, j, k, l);
line(i+100, j-5, k+100, l-20);
}
function Antenna(m, n, o, p) {
stroke(255);
strokeWeight(5);
line(m, n, o, p);
noFill();
ellipse(200, n-85, o-180, p-30);
noStroke();
}
function mouth(q, r, s, t) {
fill(255, 0, 127);
ellipse(q, r, s, t);
}
function bodyandarms(u, v, w, x) {
stroke(0);
strokeWeight(30);
line(u, v, w, x);
noStroke();
fill(255, 255, 0);
rect(u, v-75, w-200, x-100);
}