Our first SKSpriteNode class

The SKSpriteNode class https://developer.apple.com/library/ios/documentation/SpriteKit/Reference/SKSpriteNode_Ref is the one that we are going to use in order to load the sprites that will be a part of our game.

The SKSpriteNode class is a subclass of SKNode, and it's used to represent visual elements called sprites on the screen by using images. As you are going to need an image to create a sprite (an instance of SKSpriteNode class), perform the following steps to add it to the project:

  1. Unzip the 7338_01_Resources.zip file in the desired location.
  2. In Xcode, right-click on the InsideTheHat group on the Navigator tab, select New Group, and call it Art.
  3. Right-click on the Art group and select Add Files to InsideTheHat…

Get Getting Started with SpriteKit now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.