class Bewegung{ int idNr; float xpos, ypos; float radius = random(12.5,17.5); float gamma = random(0.05,0.15); float minradius = radius * 0.9; float maxradius = radius * 1.1; float radiushalf = radius/2; float gammaBewegungX = random(-1,3); float gammaBewegungY = random(-1,3); color paint = color(random(220),random(220),random(255),80); color fressenpaint = color(random(0),random(0),random(0),255); boolean picked = false; Bewegung(){ idNr = Zaehler.getNo(); xpos = int(random(radius,width-radius)); ypos = int(random(radius,height-radius)); } //------- void zeichnen(){ } //------- void mundbewegung(){ } //------- void atmen(){ } //------- void virus(){ } //------- void bewegen(){ if(picked) return; xpos += gammaBewegungX; ypos += gammaBewegungY; if(xpos + radiushalf > width | xpos - radiushalf < 0){ gammaBewegungX = -gammaBewegungX; } if(ypos + radiushalf > height | ypos - radiushalf < 0){ gammaBewegungY = -gammaBewegungY; } } //------- void kollision(Bewegung q2){ } //------- void mauspick(){ if(mouseX < xpos + radiushalf & mouseX > xpos - radiushalf & mouseY < ypos + radiushalf & mouseY > ypos - radiushalf){ picked = true; xpos = mouseX; ypos = mouseY; } else picked = false; } //------- }