10. Games with SpriteKit

In Chapter 5, “Making a Game,” you created a tic-tac-toe game with basic graphics. As you did so, you also learned how to organize code for a game by using things like classes, functions, and structs. While this chapter continues to build on those concepts, it focuses more on animation. For tic-tac-toe, you wrote code to change the X and O graphics each time a player touched the game board. This worked well for that small project, but would it work for games that involve frame-based animation? For such games, you should consider using Apple’s SpriteKit library. SpriteKit gives you an infrastructure for handling many aspects of game creation. This chapter focuses on how it helps with 2D animation, basic physics, and sound ...

Get Learning Swift™ Programming 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.