xxxxxxxxxx
24
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
drawHappyFace(mouseX, mouseY);
}
// function to draw a happy face
function drawHappyFace(x, y) {
push();
translate(x, y);
fill(255, 255, 0);
strokeWeight(15);
stroke(0);
circle(0, 0, 200);
line(-30, -30, -30, -10);
line(30, -30, 30, -10);
arc(0, 20, 60, 60, 0, PI);
pop();
}