xxxxxxxxxx
24
function setup() {
createCanvas(400, 400);
}
let x=0;
let speedx=10;
function draw() {
background(0);
noFill()
stroke(255)
circle(x,height/2,100)
x=x+speedx
if (x>width) {
//speedx=-10
speedx*=-1
}
if (x<0) {
//speedx=10
speedx*=-1
}
}