Implement collision masks, so something like this can be done:
physicsBody.collisionCategory = PLAYER
physicsBody.collisionMask = WORLD | ENEMIES | BULLETS
bulletBody.category = BULLETS
Not only does this eliminate a lot of unnecessary checks for the physics system, but it also eliminates checks in the trigger handler (#60) for something like this:
bulletBody.collisionMask = PLAYER
bulletBody.trigger = true
bulletBody.triggerHandler = { player in player.die() }
As opposed to having to make sure that the other entity in the handler is the player.
Implement collision masks, so something like this can be done:
Not only does this eliminate a lot of unnecessary checks for the physics system, but it also eliminates checks in the trigger handler (#60) for something like this:
As opposed to having to make sure that the other entity in the handler is the player.