Chapter 5. Physics in Sprite Kit
In previous chapters, we had gone through essentials to develop a game in Sprite Kit. Also, we have already developed starting scenes, which are different screen views associated with menu items.
To recap the previous chapter, where we discussed about nodes in detail, we studied the SKNode
class and its associated properties and functions. Along with this, we discussed about building a node tree and actions on a node tree. We also applied major subclasses in our game, such as SKLabelNode
, SKCropNode
, SKShapeNode
, SKEmitterNode
, SKLightNode
, and SKVideoNode
to create the menu scene. Now, the time has come to venture further into Sprite Kit.
In the real world we are affected by many physical laws, such as mass, gravity, velocity, and so on. To make a game more realistic, Sprite Kit provides us with some classes and functions, which are used to make nodes act like bodies as in a real environment. By applying these classes to characters, environment...