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