I am using sprite kit to make some games. Whenever the didBeginContact method be called, I really want to know which is enemy and which is bullet. So my questions are:1.What is the relationship of bodyA and bodyB in the didBeginContact method? 2.Is there some order between them?
BTW: sorry for my poor English, any help will be appreciated.
if contact.bodyA.categoryBitMask == bulletCategory{
bullet = contact.bodyA.node as SKSpriteNode
enemy = contact.bodyB.node as SKSpriteNode
}else if contact.bodyB.categoryBitMask == bulletCategory{
bullet = contact.bodyB.node as SKSpriteNode
enemy = contact.bodyA.node as SKSpriteNode
}