int x=250;int y=250;int speed=6;
void setup(){ size(500,500);}void draw(){ background(0); ellipseMode(CENTER); ellipse(x,y,50,50); if(x>475 || x>0) speed=-speed; x=x+speed; }