Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //sprite with horizontal physics body
- spriteMatrix[i][j].physicsBody = SKPhysicsBody(edgeFromPoint: CGPointMake(0, tileSegmentHeight), toPoint: CGPointMake(tileSegmentWidth, tileSegmentHeight))
- spriteMatrix[i][j].physicsBody!.categoryBitMask = self.surfaceCatagory
- spriteMatrix[i][j].physicsBody!.contactTestBitMask = heroCatagory
- //sprite with vertical physics body
- self.hero.physicsBody = SKPhysicsBody(edgeFromPoint: CGPointMake(self.hero.frame.width / 2, self.hero.frame.height / 2), toPoint: CGPointMake(self.hero.frame.width / 2, -20))
- self.hero.physicsBody!.categoryBitMask = heroCatagory
- self.hero.physicsBody!.contactTestBitMask = surfaceCatagory
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement