xxxxxxxxxx
27
let x = 50;
let speed = 1;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(255);
let y = 25;
while ( y < width){
ellipse(x, y, 50, 50);
y = y + 50;
}
x = x + speed;
if (x > width - 50) {
speed = -1;
} else if (x == 50) {
speed = 1;
}
}