Book Image

Swift by Example

By : Giordano Scalzo
Book Image

Swift by Example

By: Giordano Scalzo

Overview of this book

Table of Contents (15 chapters)

A stage for a bird

Let's kick-start the game by implementing the background, which is not as straightforward as it might sound.

SpriteKit in a nutshell

SpriteKit is a powerful, but easy-to-use, game framework introduced in iOS 7.

It basically provides the infrastructure to move images onto the screen and interact with them.

It also provides a physics engine (based on Box2D), a particles engine, and basic sound playback support, making it particularly suitable for casual games.

The content of the game is drawn inside an SKView, which is a particular kind of UIView, so it can be placed inside a normal hierarchy of UIViews.

The content of the game is organized into scenes, represented by subclasses of SKScene. Different parts of the game, such as the menu, levels, and so on, must be implemented in different SKScenes. You can consider an SK in SpriteKit as an equivalent of the UIViewController.

Inside an SKScene, the elements of the game are grouped in the SKNode's tree which tells the SKScene how...