int MAX_CIRCLE_NUM = 100;
float RADIOUS = 100;
float RADIOUS_VARIANT_SIZE = 20;
float POSITION_VARIANT_SIZE = 20;
ArrayList<Circle> circles;
void setup(){
size(500, 500);
smooth();
background(0);
frameRate(30);
circles = new ArrayList<Circle>();
}
void draw(){
background(255);
circles.add(new Circle());
if(circles.size() == MAX_CIRCLE_NUM){
circles.remove(0);
}
for(Circle circle: circles){
circle.draw();
}
}
class Circle{
float x;
float y;
float xRadious;
float yRadious;
Circle(){
x = mouseX + (2.0 * random(POSITION_VARIANT_SIZE) - POSITION_VARIANT_SIZE);
y = mouseY + (2.0 * random(POSITION_VARIANT_SIZE) - POSITION_VARIANT_SIZE);
xRadious = RADIOUS + (2.0 * random(RADIOUS_VARIANT_SIZE) - RADIOUS_VARIANT_SIZE);
yRadious = RADIOUS + (2.0 * random(RADIOUS_VARIANT_SIZE) - RADIOUS_VARIANT_SIZE);
}
void draw(){
stroke(0);
strokeWeight(0.5);
noFill();
arc(x, y, xRadious * 2, yRadious * 2, 0, PI * 2);
}
}