When the ship or the asteroids reach the end of the screen, they should appear on the opposite side. This is called Screen Wrapping.