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

Popular posts from this blog

My HTML document is not linking to my CSS stylesheet properly -

php array slice every 2th rule -

node.js - Sending sockets to client side, Error: Converting circular structure to JSON -