xxxxxxxxxx
//using a function to draw a face
void setup() {
size(800, 400);
}
void draw() {
background(#57796A);
drawFace(width/2, 200);
//for (int i = 100; i< width - 100; i+=20) {
// drawFace( i, 150);
//}
}
void drawFace(float x, float y) {
fill(#E3CF32);
ellipse(x, y, 190, 190);
drawEyes(x, y);
drawMouth(x, y);
}
void drawEyes(float x, float y) {
fill(0);
ellipse(x-50, y-30, 25, 25);
ellipse(x+50, y-30, 25, 25);
}
void drawMouth(float x, float y) {
noFill();
arc(x, y, 130, 100, PI/7, PI-PI/7);
}