views:

86

answers:

1

Hello.

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.

A: 

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.

Colin Gislason
Hello. Thanks for the reply. In the end I worked out how to use my main dynamic body to move the parallax node, once I've tidied I'll be posting my code in case it helps others.
Andrew