Chapter 2. What Makes a Game a Game?

In Chapter 1, The First Step toward SpriteKit, we set the basis of our game by adding a background and the first sprite to our project. In the following pages, I will show you the key elements that take part in every game, such as the movement of sprites in a scene, the detection of touches, and the handling of collisions. You will also learn how to add labels to a scene and play music and sound effects.

The things that you will learn in this chapter are as follows:

  • How to detect touch interaction
  • How to execute actions on sprites
  • How to handle collisions
  • Creating and updating labels
  • Playing music and sound effects

Handling touch events

Our beloved main character is supposed to run though several doors, but some of ...

Get Getting Started with SpriteKit now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.