xxxxxxxxxx
24
let x=0,y=200,v=2,t=1;
function setup() {
createCanvas(400, 400);
stroke(0,200,0); // circle fill and border color
fill(0,200,200);
}
function draw() {
background(200,200,0);
draw_it();
move_it();
}
function draw_it() {
circle(x,y,20); // start with a easy object: circle
}
function move_it(){
x += v * t; // new pos = old pos + distance // distance = speed * time
if ( x > width ) x = 0; // wrap
}