int n = 30; Circle[] c = new Circle[n]; void setup() { size(320, 200); //size(640, 480); for(int i = 0; i < n; i++) { c[i] = new Circle(); } //ellipseMode(CENTER_DIAMETER); frameRate(30); smooth(); noFill(); } void draw() { for(int i = 0; i < n; i++) { c[i].update(); } background(255); for(int i = 0; i < n; i++) { c[i].show(); } } class Circle { float x, y, r, maxR; color c; Circle() { x = random(width/4, width/2 + width/4); y = random(height/4, height/2 + height/4); maxR = random(10, 25); r = random(maxR); } void update() { r += 0.6; if(r > maxR) { r = 1; maxR = random(10, 25); //x = random(width/4, width/2 + width/4); //y = random(height/4, height/2 + height/4); } x = random(width); y = random(height); } } void show() { c = color(93, 135, 255, 255 - (r/maxR)*255); stroke(c); ellipse(x, y, r*2, r*2); } }