class Kreis0{ int xpos, ypos; float radius=random(20,70); float minRadius = radius * 0.9; float maxRadius = radius * 1.1; float delta = random(0.1,0.2); float gammaBewegungX = random(-1,3); float gammaBewegungY = random(-1,3); float radiushalf = radius/2; color paint; Kreis0(){ xpos = int(random(width)); ypos = int(random(height)); paint = color(random(200),random(255),random(200),120); } void drawKreis(){ fill(paint); ellipse(xpos,ypos,radius,radius); } void breatheKreis(){ radius += delta; if (radius > maxRadius | radius < minRadius) delta = -delta; } void bewegen(){ xpos += gammaBewegungX; ypos += gammaBewegungY; if(xpos + radiushalf > width | xpos - radiushalf < 0){ gammaBewegungX = -gammaBewegungX; } if(ypos + radiushalf > height | ypos - radiushalf < 0){ gammaBewegungY = -gammaBewegungY; } } //------- }