Ok so I have a time animated bad guy & a missile that shoots at him.
I use this for collision detection..
Code:
if (CGRectContainsRect([myBub1 frame], [missile frame]))
{
[myBub1 removeFromSuperview];
[bubMoveTimer1 invalidate];
[missileTimer invalidate];
missile.center = bubView.center;
missileButtonPressed = NO;
missile.hidden = YES;
}
it removes my bad guy, invalidates the movement timers and moves the missile back to my good guy to be fired again.
well that all works perfect but my problem is that when I fire again at the same spot that I killed the last bad guy the missile hits something at the same spot that the bad guy was at and it crashes my app..
It's like my badguy leaves behind his frame when I remove him from the superview & when it goes to remove him again it kills the app (because he's already been removed)
Any ideas??