var circles = []; function setup(){ setFrameRate(60); createCanvas(windowWidth, windowHeight); strokeWeight(1); } function draw(){ fill(55); while (true){ var circle = new Circle(random(windowWidth), random(windowHeight), 1); if (circle.touchesCircle()) circle.valid = false; if (circle.valid) circles.push(circle); break; } for (var c of circles){ if (c.touchesEdges() || c.touchesCircle()) c.done = true; if (!c.done) c.grow(); c.draw(); } }