xxxxxxxxxx
42
function setup() {
createCanvas(windowWidth, windowHeight);
}
let x0 = 0;
let x1 = 0;
let x2 = 0;
function draw() {
background(220, 20, 120);
let y0 = height / 3;
let y1 = height / 2;
let y2 = (2 / 3) * height;
let x0start = 0;
let x1start = 0;
let x2start = width / 4;
let x0end = width;
let x1end = width / 2;
let x2end = (3 / 4) * width;
ellipse(x0, y0, 25);
ellipse(x1, y1, 25);
ellipse(x2, y2, 25);
x0 += 6;
if (x0 > x0end) {
x0 = x0start;
}
x1 += 2;
if (x1 > x1end) {
x1 = x1start;
}
x2 += 4;
if (x2 > x2end) {
x2 = x2start;
}
}