xxxxxxxxxx
20
let circleX=200;
let speedX= 5;
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
circleX=circleX+=speedX;
circle(circleX,height/2,20);
if(circleX>400){
speedX=-5;
circle(circleX,height/2,20);
}if(circleX<0){
speedX=5;
}
}