SpriteKit includes a fully functional physics engine. It is easy to implement and very useful; most mobile game designs require some level of physical interaction between game objects. In our game, we want to know when the player runs into the ground, an enemy, or a power-up. The physics system can track these collisions and execute our specific game code when any of these events occur. SpriteKit's physics engine can also apply gravity to the world, bounce and spin colliding sprites against each other, and create realistic movement through impulses – and it does all of this before every single frame is drawn to the screen.
The topics in this chapter include: