I assume you want to make some kind of infinite game?
In most cases the best you can do is to fake it, so it gives the illusion of looping. Which you can do if you make some background objects and spawn them at the edge and let them travel to the opposite edge. And then make it so they spawn at different X coordinates and maybe let them travel at different speed.