p5((s) => {
let system, k, offset, bg, cnt;
bg = getColor();
s.setup = function () {
s.createCanvas(W, H);
k = 0;
cnt = 0;
s.noStroke();
};
s.draw = function () {
s.background(bg);
for (let n = 0; n < k; n++) {
s.fill(sgs[n].clr);
s.push();
s.translate(sgs[n].x, sgs[n].y);
s.rotate(s.TWO_PI * (sgs[n].itr * 0.01) * (cnt / 360.0));
offset = -sgs[n].r * 0.5;
s.rect(offset, offset, sgs[n].r, sgs[n].r);
s.pop();
if (sgs[n].r < 1000) {
sgs[n].r += 6;
} else {
sgs[n].r = 50;
}
}
if (cnt % 10 == 0 && k < sgs.length) {
k++;
}
if (k > sgs.length) {
k = 0;
}
cnt += 1.0;
};
})