Game Development Reference
In-Depth Information
9.
Here, we find a node with
parallaxName
, and we remove it if it is off the
screen. If the current parallax layer is halfway done or so, we create a new
parallax layer and set its position to where the last one ends, so that they
interconnect flawlessly. The following screenshot shows the addition of
parallax.png
to
Images.xcassets
:
Adding parallax.png to Images.xcassets
Build and run the project, and you will see that the parallax background layer adds
to the atmosphere and look of the project. Suddenly, our game has gained depth and
looks great, as shown in the following screenshot:
The parallax layer adds depth to our game