class Circle{ constructor(x, y, r){ this.x = x; this.y = y; this.r = r; this.done = false; this.valid = true; } draw(){ellipse(this.x, this.y, this.r * 2, this.r * 2);} grow(){this.r ++;} touchesEdges(){ if (this.x + this.r > windowWidth || this.x - this.r < 0 || this.y + this.r > windowHeight || this.y - this.r < 0) return true; } touchesCircle(){ for (var c of circles){ if (c == this) continue; if (dist(this.x, this.y, c.x, c.y) < this.r + c.r) return true; } } }