O'Reilly logo

Swift 3 Game Development - Second Edition by Stephen Haney

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

Organizing your assets

We will quickly overrun our project navigator with image files if we add all our textures as we did with our bee. Luckily, Xcode provides several solutions.

Exploring Assets.xcassets

We can store images in an .xcassets file and refer to them easily from our code. Follow these steps to prepare our .xcassets file:

  1. Open Assets.xcassets from your project navigator.
  2. Notice that SpriteKit placed a demo spaceship image here. We do not need it, so we can right-click on it and choose Remove Selected Items to delete it.
  3. You will also see an empty AppIcon entry. You can leave it there for now; we will revisit the AppIcon later.

Collecting art into texture atlases

We will use texture atlases for most of our in-game art. Texture atlases organize ...

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