xxxxxxxxxx
46
rad = 0;
i = 0;
count = 0;
function setup() {
createCanvas(800, 800);
background(245, 243, 240);
rR = random(0, 255);
rG = random(0, 255);
rB = random(0, 255);
rX = random(-200, 200);
rY = random(-200, 0);
}
function draw() {
translate(width / 2, height / 2);
var angle = TAU / 200;
var x = cos(angle * i) * rad;
var y = sin(angle * i) * rad;
i = i + 0.5;
if (x + rX < -200 || x + rX > 200 || y + rY < -200 || y + rY > 200) {
stroke(245, 243, 240);
}
else {
stroke(rR, rG, rB);
}
ellipse(x + rX, y + rY, 1);
if (x == rad) {
rad = rad + 1;
rR = random(0, 255);
rG = random(0, 255);
rB = random(0, 255);
}
if (rad > 150) {
rad = 0;
rX = random(-200, 200);
rY = rY + random(50, 100);
count = count + 1
}
}