Advertisement
Guest User

Untitled

a guest
Apr 28th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. //sprite with horizontal physics body
  2. spriteMatrix[i][j].physicsBody = SKPhysicsBody(edgeFromPoint: CGPointMake(0, tileSegmentHeight), toPoint: CGPointMake(tileSegmentWidth, tileSegmentHeight))
  3. spriteMatrix[i][j].physicsBody!.categoryBitMask = self.surfaceCatagory
  4. spriteMatrix[i][j].physicsBody!.contactTestBitMask = heroCatagory
  5.  
  6. //sprite with vertical physics body
  7. self.hero.physicsBody = SKPhysicsBody(edgeFromPoint: CGPointMake(self.hero.frame.width / 2, self.hero.frame.height / 2), toPoint: CGPointMake(self.hero.frame.width / 2, -20))
  8. self.hero.physicsBody!.categoryBitMask = heroCatagory
  9. self.hero.physicsBody!.contactTestBitMask = surfaceCatagory
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement