Hey so ive been working with Shivaz awesome code for collision detection using chipmunk and ive been going throught all different kinds of methods on how i can make it so the sprites wont go through eachother. i found that possibly i could use something like this:
PlayerSprite *player1Sprite = a->data;
PlayerSprite *player2Sprite = b->data;
if( player1Sprite) {
float oldPositionx = a->body->p.x;
float oldPositiony = a->body->p.y;
[player1Sprite setPosition:ccp(oldPositionx, oldPositiony)];
}
This does work but the problem im having is that after that happens i cant move the sprite anymore as long as its colliding since its always set to the old position. If i were to move the sprite it collided with they can all move again. So my question is how can i make it so i can move it even if it is colliding?
Thanks
-Lars