int x=250;int y=250;int speed=5;
void setup() {size(800,800);}
void draw(){ background(0); ellipseMode(CENTER); ellipse(x,y,50,50); x=x+speed; if(x>800 ) speed=-speed; if(x<0) speed=+speed;}