O'Reilly logo

iOS 7 Game Development by Dmitry Volevodz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding a parallax background

As you may have noticed, we have huge grey windows in our background (see the screenshot in the Adding shield animations section), and it would be great to add a parallax background over it. We will do it the same way we did with the original background. We will add new sprite nodes and move them every frame.

The things that need to be done to add a parallax background are as follows:

  1. Add parallax.png to images.xcassets in the Xcode project, either by drag-and-drop or by clicking on the plus button in Xcassets. Select parallax in the left Xcassets pane and move it from 1x to 2x by dragging, as we have high-resolution artwork (see the following screenshot).
  2. The next thing we need is some variables in Common.h:
    static NSString ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required