O'Reilly logo

Getting Started with SpriteKit by Jorge Jordán

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Collision management

In the previous section of this chapter, we learned the most important techniques to perform actions on nodes, namely movements. Now that everything is moving, we need a way to detect when the main character tries to cross a closed door (a wrong door) or an open one (a correct door).

Detecting and handling collisions is one of the main techniques in game development, as a vast percentage of games is founded upon enemies trying to hit our character in many different ways or the player trying to kill the enemies by shooting them, jumping at them, and so on. But, what is a collision?

Understanding collisions

In game development, a collision is an intersection between two or more elements in a scene. There are different ways to detect ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required