-(void)handleContact:(SKPhysicsContact*)contact{
NSArray *nodeNames = @[contact.bodyA.node.name, contact.bodyB.node.name];
if ([nodeName containsObject:player] && [nodeName containsObject:window] { //player and windows are defined strings which are set in SKSpriteNode names
Do something to window
} else if ([nodeName containsObject:player] && [nodeName containsObject:door])
Do something to door
} //Continue another 10 times with different defined strings except player
}
Would this sort of code be ideal for collision detection or is there a better way i can face this?