Chapter    2

Sprite Kit Scenes and SKNode Positioning

In the previous chapter I talked about what Sprite Kit was and how you can use it to create 2D games. I then jumped right in and showed how to start working with the SKSpriteNode to create a background and player sprite and then showed how to add them to a game scene.

In this chapter, I am going to step back a bit and give you a deeper look at Sprite Kit scenes, including how scenes are built and why the order they are built in can change your game. I will close the chapter with a discussion of Sprite Kit coordinate systems and anchor points as they relate to SKNodes.

What Is an SKScene?

I used the SKScene object in the previous chapter to host the background and player nodes, but I really ...

Get Beginning Swift Games Development for iOS 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.