Now we are all ready with our spaceship. It's time to add some more in the game. So our next target is to add infinite scrolling to the game, so that we can make our spaceship move infinitely in space. In this recipe, we will be learning about the ways to add infinite scrolling to games.
For an infinite scrolling background you need to know about the anatomy of SpriteKit shown earlier. You should be aware of the rendering loop, how in a particular frame the update method functions, and how SKScene
evaluates the actions and physics simulation thereby rendering all the stuff in the SKView
. Now using this loop, you implement sky scrolling infinitely giving the feel of a spaceship flying.