I have bullets. That are being shot at 0.5 seconds. When they collide to the wall i want them to desappear. The problem is when i have more than one bullet on the screen. The handler doesn't treat the collision.
It's like it can't be called successfully.
My code is:
Code: Select all
- (BOOL) handleCollision:(CollisionMoment)moment arbiter:(cpArbiter*)arb space:(cpSpace*)space
{
if (moment == COLLISION_BEGIN || moment == COLLISION_PRESOLVE) {
CP_ARBITER_GET_SHAPES(arb, bullet, wall);
[self prepareToDie];
[self die];
}
return YES;
}