Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Game with Sprite Kit Physics and Collision World Setup and Physics Bodies

How do you get rid of the green block on the bottom of the screen withl losing its physicsBody contact make it invisible

That's it

1 Answer

Shaun Kelly
Shaun Kelly
5,648 Points

you can add ground.zposition = 15; to make the ground come behind the background but it still has the physics added and everything. like this.....

GroundNode *ground = [self spriteNodeWithColor:[SKColor yellowColor] size:size];
    ground.name = @"Ground";
    [ground setUpPhysics];
    ground.zPosition = 15;    //<<<
    ground.position = CGPointMake(size.width/2, size.height/2);