xxxxxxxxxx
30
let isRotate = false;
let r = 1;
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
background(0);
translate(width / 2, height / 2);
if (random(1) > 0.999 && !isRotate) {
console.log("ROTATE");
isRotate = true;
setTimeout(function() {
isRotate = false;
console.log("HI", isRotate);
}, random(1000, 10000));
}
if (isRotate) r += 0.001;
rotate(r)
stroke(255, 128);
for (let a = 0; a < TWO_PI; a += TWO_PI/12) {
let x = cos(a) * height / 2;
let y = sin(a) * height / 2;
line(0, 0, x, y);
}
fill(255, 100);
noStroke();
ellipse(0, 0, height, height);
}