Sprite Kit makes it easy to build compelling, high-performance games for iOS and OS X using the same object-oriented principles, design patterns, and Objective-C language that you use to build other apps. To demonstrate what you can accomplish with Sprite Kit, we’ve created the complete Adventure game:


This code:Explained provides an overview and guided tour through the Adventure Xcode project. By working through this document, you’ll see how we used Sprite Kit nodes, actions, and physics, to build a level in which you play the role of an intrepid hero walking through the walls of a forested maze. There are several different characters and basic sprites that make up the game, including your hero, caves that spawn the evil goblins you’ll encounter along the way, not to mention the club-wielding boss at the end of the level.


What You’ll Learn from This code:Explained

This document is designed to be read alongside the Adventure Xcode project, giving you context and additional explanation as you work through the sample code.

What You Need to Know Before Reading This Document

Building a game with Sprite Kit involves all the same tools and techniques you use when building other apps using Objective-C and Cocoa or Cocoa Touch. For example, Adventure uses a storyboard for iOS, and a MainMenu.xib file for OS X, to create a simple app interface containing the view in which the game content is displayed. If you don’t already have a good understanding of app development for iOS and OS X, you should read Start Developing iOS Apps Today or Start Developing Mac Apps Today.

To get the most out of this document and the Adventure sample project, read at least the early chapters of SpriteKit Programming Guide. You’ll get a general understanding of the Sprite Kit framework and learn the basic elements used to display information on screen—such as views, scenes, nodes, actions, and physics bodies, all of which are used in Adventure.