Configure Physics Categories
Before you can set up physics categories, you first need to understand what SpriteKit does when two physics bodies attempt to occupy the same space, and what types of interactions are possible. With SpriteKit, there are two types of interactions: a contact and a collision. A contact occurs the moment body A touches body B. A collision occurs when two bodies collide. The difference between these two interactions is subtle but important. The first type of interaction is generally used to handle some type of game logic. For example, knowing when the player collects an item. The second type of interaction is used more for simulating real-world physics—for example, a ball bouncing off the side of a wall.
SpriteKit determines ...
Get Apple Game Frameworks and Technologies now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.