xxxxxxxxxx
21
let x;
let xspeed = 1;
function setup() {
createCanvas(400, 400);
x = width / 2;
}
function draw() {
background(250);
x += xspeed;
if (x <= 0 || x >= width) {
xspeed *= -1;
}
fill(0)
ellipse(x, height / 2, 100, 100);
}