xxxxxxxxxx
27
var x=1;
var speed= 3;
function setup() {
createCanvas(400, 400);
rectMode(CENTER);
}
function draw() {
background(0);
stroke(255);
strokeWeight(5);
noFill();
ellipse(x, 200, 100,100);
if(x > width || x<0) {
speed= speed * -1;
}
x= x + speed;
//I don't understand this logic. Check back
}