Advertisement
Guest User

Untitled

a guest
Apr 20th, 2014
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. self.physicsBody = [SKPhysicsBody bodyWithEdgeLoopFromRect:self.frame];
  2. self.physicsBody.categoryBitMask = SceneEdgeCategory;
  3.  
  4. hero.physicsBody.collisionBitMask = SceneEdgeCategory;
  5.  
  6. //make sure that you define the topLeftPoint, bottomLeftPoint, topRightPoint and bottomLeftPoint variables
  7.  
  8. self.leftPhysicsBody = [SKPhysicsBody bodyWithEdgeFromPoint:topLeftPoint toPoint:bottomLeftPoint];
  9. self.leftPhysicsBody.categoryBitMask = SceneEdgeCategory;
  10.  
  11. self.rightPhysicsBody = [SKPhysicsBody bodyWithEdgeFromPoint:topRightPoint toPoint:bottomRightPoint];
  12. self.rightPhysicsBody.categoryBitMask = SceneEdgeCategory;
  13.  
  14. CGPoint topRightPoint = CGPointMake(self.frame.size.width, self.frame.size.height);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement