class Kreis extends Bewegung{ color paint = color(random(255),random(255),random(255),180); Kreis(){ } //------- void zeichnen(){ fill(paint); ellipse(xpos,ypos,radius,radius); } //------- void atmen(){ radius += gamma; if(radius > maxradius | radius < minradius) gamma = -gamma; } //------- void kollision(Bewegung q2){ if((abs(xpos - q2.xpos) < (radiushalf + q2.radiushalf)) & abs(ypos - q2.ypos) < (radiushalf + q2.radiushalf)){ gammaBewegungX = -gammaBewegungX; gammaBewegungY = -gammaBewegungY; } } //------- void virus(){ paint = fressenpaint; } //------- }