class Pacman extends Bewegung{ color paint = color(random(250,255),random(250,255),random(0,0),205); float gammastart = PI/4; float gammabewegung = 0.05; Pacman(){ } //------- void zeichnen(){ fill(paint); arc(xpos,ypos,radius+10,radius+10,gammastart,TWO_PI-gammastart); fill(0); ellipse(xpos-2,ypos-5,3,3); } //------- void mundbewegung(){ gammastart += gammabewegung; if(gammastart < 0 | gammastart > PI/4){ gammabewegung = -gammabewegung; } } //------- void kollision(Bewegung q2){ if((abs(xpos - q2.xpos) < (radiushalf + q2.radiushalf)) & abs(ypos - q2.ypos) < (radiushalf + q2.radiushalf)){ if (q2 instanceof Kreis){ q2.virus(); } gammaBewegungX = -gammaBewegungX; gammaBewegungY = -gammaBewegungY; } } //------- }