Tutorial by Examples: didbegincontact

IF you are using simple categories, with each physics body belonging to only one category, then this alternative form of didBeginContact may be more readable: func didBeginContact(contact: SKPhysicsContact) { let contactMask = contact.bodyA.categoryBitMask | contact.bodyB.categoryBitMask ...
// PHYSICS CONSTANTS struct PhysicsCategory { static let None : UInt32 = 0 static let All : UInt32 = UInt32.max static let player : UInt32 = 0b1 // 1 static let bullet : UInt32 = 0b10 // 2 } var nodesToRemove = [SKNode]() /...

Page 1 of 1