How to create a border in a sprite set

I just started making the game using a set of sprites, and I need to know how to adjust the border so that my character stays on the screen, since it does not fall off due to gravity and does not sail off when you press the screen enough.

+3
source share
1 answer

Define physicsBodyfor SKScene:

self.physicsBody = [SKPhysicsBody bodyWithEdgeLoopFromRect:self.frame];

Well described in Apple's documentation , listing 8-1

+7
source

All Articles