Reputation: 223
Just started making a game using sprite kit and what i need to know is how do i set up a boundary so my character stays on the screen,as in doesn't fall away due to gravity and doesn't float away when you tap the screen enough.
Upvotes: 3
Views: 2491
Reputation: 32559
Define physicsBody
for SKScene
:
self.physicsBody = [SKPhysicsBody bodyWithEdgeLoopFromRect:self.frame];
Described well in Apple's documentation, Listing 8-1
Upvotes: 10