objective c - ideal way for detecting collisions in sprite kit? -
-(void)handlecontact:(skphysicscontact*)contact{ nsarray *nodenames = @[contact.bodya.node.name, contact.bodyb.node.name]; if ([nodename containsobject:player] && [nodename containsobject:window] { //player , windows defined strings set in skspritenode names window } else if ([nodename containsobject:player] && [nodename containsobject:door]) door } //continue 10 times different defined strings except player }
would sort of code ideal collision detection or there better way can face this?
Comments
Post a Comment