Consider this sample code that demonstrates how to have an object seemlessly wrap its position around the screen. Notice that this involves drawing the object three times! And if you want it to wrap around vertically too, you may have to draw it nine times!
float x = 100;
void setup(){
size(200,200);
}
void draw(){
background(0);
x += 4;
x += width;
x %= width;
ellipse( x-width, 100, 20, 20 );
ellipse( x, 100, 20, 20 );
ellipse( x+width, 100, 20, 20 );
}
Understand the concepts this code presents, and then attempt to apply them to your own code. Post the code of your attempt (and format it for once - select the code and hit the FORMAT AS CODE button, which looks like this: </> ) for more help.