xxxxxxxxxx
36
let x = 0;
let y = 0;
let radius = 0;
let circlesPerFrame = 12;
let maxRadius = 200;
let r, g, b, maxDeviation;
function setup() {
createCanvas(400, 400);
background(0);
noFill();
frameRate(60);
r = random(256);
g = random(256);
b = random(256);
maxDeviation = random(-256, 256);
}
function randomColor() {
return color(r + random(maxDeviation), g + random(maxDeviation), b + random(maxDeviation));
}
function draw() {
for (let i = 0; i < circlesPerFrame; i++) {
stroke(randomColor());
circle(x, y, radius+i);
}
radius += circlesPerFrame;
if (radius > maxRadius) {
radius = 0;
x = random(width);
y = random(height);
}
}