xxxxxxxxxx
16
let x = 0;
let xSpeed = 3;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
x = x + xSpeed;
if (x > width) xSpeed *= -1;
else if (x<0) xSpeed *= -1;
ellipse(x,height/2,20,20);
}