xxxxxxxxxx
21
const BALL_COUNT = 10;
const BALL_SIZE = 10;
function setup() {
createCanvas(400, 400);
}
function draw() {
background('#DDD');
noFill();
stroke('#333');
for (let i = 0; i < BALL_COUNT; i++) {
push();
circle(
i * BALL_SIZE * 2 + cos(frameCount / 100) * 10 * i,
height / 2 + sin(frameCount / 100) * 10 * i,
BALL_SIZE);
pop();
}
}