xxxxxxxxxx
35
function setup() {
createCanvas(400, 400);
background(220);
noStroke();
angleMode(DEGREES)
}
function draw() {
pacman(100,100);
pacman(200,200);
}
function pacman(tempX,tempY) {
//body
fill(247, 234, 52);
arc(tempX,tempY,50,50,45,315)
//eye
fill(0);
circle(tempX+5, tempY-15,6);
//glasses
fill(100,0)
strokeWeight(3)
stroke(20)
line(tempX-4 , tempY - 15, tempX - 20, tempY-15)
circle(tempX +5,tempY -15,20)
noStroke()
fill(56, 50, 168)
rect(tempX-23,tempY+5,40,20)
}