I've been trying without much success to simply remove an individual chipmunk body on touch for a simple iphone game I'm creating.
For the sake of simplicity the current code I'm using declares the image, shape and body as it should and loads the game then runs through it using the NSTimer. However my ontouch method removes the image itself completely fine (By using something along the lines of " [testBall removeFromSuperview]; " )
However despite using what I think is the correct syntax for chipmunk it doesn't remove the 'testBall's body, meaning its still interacting despite the image itself not actually being there.
The list of things I've tried :
Code: Select all
void cpSpaceRemoveBody(cpSpace *ballSpace, cpBody *ballBody);
void cpSpaceRemoveShape(cpSpace *ballSpace, cpShape *ballShape);
void cpSpaceFree(cpSpace *ballSpace);
void cpSpaceFreeChildren(cpSpace *ballSpace);
void cpShapeDestroy(cpShape *ballShape);
[testBall removeFromSuperview];
Any help would be fantastic