Add the Resources

Rather than have you jump in and out of Finder over the next few chapters, you’ll add all of the necessary resources for this part of the book, making things a little easier to follow.

First, below the Assets.xcassets catalog, create two more groups. Name one Music and the other Sounds.

In the Project Navigator, select the Assets.xcassets catalog and add four new sprite atlases (click the + button at the bottom of the Outline View and select New Sprite Atlas). Name these new atlases as follows:

  • collectibles
  • health
  • monster_goblin
  • monster_skeleton

Xcode 12 and Sprite Atlas Creation

images/aside-icons/important.png

In Xcode 12, the New Sprite Atlas option does not exist. To create a new sprite atlas, click the + button at the bottom of the Outline View and select AR and SceneKit Sprite Atlas.

When you’re done creating these new atlases, don’t forget to delete all of the default Sprite image sets Xcode creates.

Next, open Finder and navigate to the resources folder for this chapter. In Finder, switch to the list view, like this (it’s easier to drag multiple files into the project when Finder is in list view mode):

images/BuildingGamesWithEntitiesAndComponents/finder-resources.png

Finally, drag all of the resources from Finder into their respective places within your project. For example, drag all of the files from the collectibles folder into the collectibles sprite atlas, and all of the files in the sounds folder into the Sounds group.

When you drag the reference nodes, sound, and music files into their respective groups, be sure that Copy items if needed is checked, Create groups is selected, and the valsrevenge option is checked in the Add to targets box.

When you’re done, your project will look like this:

images/BuildingGamesWithEntitiesAndComponents/organized-project.png

Fantastic, you’ve got your project organized, and the resources added—you’re officially ready to get your hands dirty with entities and components.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset