xxxxxxxxxx
28
function setup() {
createCanvas(1000, 1000);
}
function draw() {
background(250);
frameRate(60);
fill(0);
stroke(250);
strokeWeight(1);
let offx = 0.03 * sin(frameCount / 50);
let offy = 0.03 * sin(frameCount / 50);
for (let i = 0; i < 600; i++) {
circle(
500 + 200 * sin(i * (0.06 + offx)),
500 + 100 * cos(i * (0.07 + offx)),
50
);
}
}
// you can put it in the mousePressed function,
// or keyPressed for example
function keyPressed() {
// this will download the first 5 seconds of the animation!
if (key === 's') {
saveGif('mySketch', 5);
}
}