ok sure
int pacx=500;
int pacy=240;
int LEFT = 0;
int RIGHT = 1;
int DOWN = 2;
int UP = 3;
int dir=RIGHT;
void setup()
{
size(500,600);
rectMode(CENTER);
ellipseMode(CENTER);
}
void draw()
{
background(0);
drawPacman();
drawRedghost(40,550);
drawPurpleghost();
drawTealghost();
//background
stroke(21,45,129);
strokeWeight(2);
line(0,95,500,95);
line(0,105,500,105);
line(0,195,500,195);
line(0,205,500,205);
line(0,295,500,295);
line(0,305,500,305);
line(0,395,500,395);
line(0,405,500,405);
line(0,495,500,495);
line(0,505,500,505);
}
void drawPacman()
{
background(0);
noStroke();
fill(255,255,0);
if(dir==LEFT){
arc(pacx,pacy,50,50,radians(45),radians(315));
pacx++;
}
else if(dir==RIGHT){
arc(pacx,pacy,50,50,radians(225),radians(495));
pacx--;
}
else if(dir==DOWN){
arc(pacx,pacy,50,50,radians(225),radians(495));
pacy++;
}
else if(dir==UP){
arc(pacx,pacy,50,50,radians(225),radians(495));
pacy--;
}
if(pacx==-50 && dir==RIGHT)
dir=DOWN;
else if(pacy==450 && dir==DOWN)
dir=LEFT;
else if(pacy==250 && dir==UP)
dir=RIGHT;
else if(pacx==520 && dir==LEFT)
dir=UP;
}
void drawRedghost(int x, int y)
{
fill(255,0,0);
rect(x,y,30,30);
arc(x,y-15,30,30,radians(180),radians(360));
triangle(x-15,y+15,x-5,y+15,x-15,y+20);
triangle(x-5,y+15,x+5,y+15,x,y+20);
triangle(x+5,y+15,x+15,y+15,x+15,y+20);
//eyes
stroke(255);
strokeWeight(10);
point(x+7,y-10);
point(x-8,y-10);
stroke(0);
strokeWeight(5);
point(x+6,y-10);
point(x-7,y-10);
}