Looping Animation

Use the if statement to make the animation loop when it reaches the edge
int x=0; void setup() { size(500,300); } void draw() { background(0); x=x+2; if ( x > 500) { x = 0; } ellipse(x,100,20,20); }