void setup() { size(500, 500); smooth();}
int x = 250;int y = 250;int v = 5;
void draw() { background(255); x = x + v; if(x >= 475 || x <= 25){ v = - v; } ellipse(x, y, 50, 50); }