Game Development Reference
In-Depth Information
Detecting contact and collisions
We apply physics simulation to the bodies by adding the SKPhysicsBody function to a
node. While the scene processes each frame, it performs all the physics-related calculations
for all the bodies in the scene. It also calculates all the custom forces that are applied on
any body in the scene, which eventually gives the realistic effects in the game. Collision
detection is an important part while developing any game in the real world because in al-
most all games we check for the collision of two bodies. For example, in any warfare
game, we may need to check whether a bullet has collided with the player.
Search WWH ::




Custom Search