xxxxxxxxxx
41
let x= 0;
let speed= 3;
function setup() {
createCanvas(600, 400);
}
function draw() {
background(220);
stroke (0);
strokeWeight (3);
noFill();
ellipse (x, 200, 100, 100)
x= x+speed
if (x > width) {
//print("OFF THE SCREEN!")
speed= -3
}
else if (x<0) {
speed=3
}
//and is like an intersection
// or is having y happen if either x happens to be true
}