xxxxxxxxxx
24
let xPosition=0;
let xSpeed=5;
function setup() {
createCanvas(400, 400);
noStroke();
}
function draw() {
background(255);
fill(250,100,10);
ellipse(xPosition,width/2,100,100);
xPosition += xSpeed;
if(xPosition > width || xPosition <0){
xSpeed *= -1;
}
}