1
votes

I'm using Cocos2D, SpaceManager and Chipmunk. I have a parallax node with 4 layers on it, this is tied to the location of a playable chipmunk body. This body needs to collide with static objects on one of the parallax layers, the static bodies must start off screen then move into screen and collide.

I know you are not supposed to move static bodies with Chipmunk, unless you rehash. However, rehashing 60 time a second to keep up with the framerate seems messy. Can anyone think of an alternate way to do this?

Cheers.

1
Can you share your code?el.severo

1 Answers

0
votes

One thing you could try is joining all the objects in each parallax layer to a non-colliding body using rigid joints. Then move that body along with the parallax layer to drag the objects along. THis may not be the best method, though.