I'm new using Chipmunk and I'm unable to find out why the following crashes. The app makes some sprites fall from the top of the screen, this works fine.
In the init method I call the next:
Code: Select all
cpSpaceAddCollisionHandler(_space, GEM_COLLISION_TYPE, FLOOR_COLLISION_TYPE, (cpCollisionBeginFunc)beginCol, NULL, NULL, NULL, NULL);
Code: Select all
static cpBool beginCol(cpArbiter *arb, cpSpace *space, void *data) {
CP_ARBITER_GET_SHAPES(arb, a, b);
cpSpaceAddPostStepCallback(space, (cpPostStepFunc)gemPostStep, a, NULL);
return TRUE;
}