xxxxxxxxxx
26
// Time interval for picking new position
let interval = 60;
// Position
let x = 0;
let y = 0;
function setup() {
createCanvas(windowWidth, windowHeight);
noStroke();
}
function draw() {
// Every second, pick a new random position
if (frameCount % interval == 0) {
x = random(width);
y = random(height);
interval = floor(random(300, 1500));
background(255);
}
// Fill a red spot
fill(255, 0, 0, 1);
// Draw the spot
ellipse(x, y, 100, 100);
}