10. Games with SpriteKit

In Chapter 5, “SpriteKit,” you learned how to program a game with SpriteKit. This chapter continues to build on those concepts, but it focuses more on animation. This chapter focuses on making a game, as well as how to build basic game concepts such as 2D animation, basic physics, and sound playback.

The Game

The game we will make is very basic in its appearance but will teach you the most important concepts of SpriteKit that you’ll definitely use every time you make a game. In this simple game, your user will control the hero as he runs away from an enemy that’s chasing him. The enemy watches your every move and stays within the bounds of the game while you try to collect the diamonds on the screen. The main point of ...

Get Learning Swift 2 Programming, Second Edition 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.