Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- self.physicsBody = [SKPhysicsBody bodyWithEdgeLoopFromRect:self.frame];
- self.physicsBody.categoryBitMask = SceneEdgeCategory;
- hero.physicsBody.collisionBitMask = SceneEdgeCategory;
- //make sure that you define the topLeftPoint, bottomLeftPoint, topRightPoint and bottomLeftPoint variables
- self.leftPhysicsBody = [SKPhysicsBody bodyWithEdgeFromPoint:topLeftPoint toPoint:bottomLeftPoint];
- self.leftPhysicsBody.categoryBitMask = SceneEdgeCategory;
- self.rightPhysicsBody = [SKPhysicsBody bodyWithEdgeFromPoint:topRightPoint toPoint:bottomRightPoint];
- self.rightPhysicsBody.categoryBitMask = SceneEdgeCategory;
- CGPoint topRightPoint = CGPointMake(self.frame.size.width, self.frame.size.height);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement