Skip to content
Browse files

Fixed bug whereby bullets still hit attackers that were dead and remo…

…ved from view.
  • Loading branch information...
1 parent 5290d8c commit fe5599541798a88669301aa697bd3bf7fe28e70b Laurence Archer committed Feb 16, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 Classes/GameScene.m
View
10 Classes/GameScene.m
@@ -398,10 +398,12 @@ -(void)checkCollisions {
// Check collision of bullets with attackers
NSMutableArray *attackersToDestroy = [[NSMutableArray alloc] init];
for (Attacker *attacker in attackers) {
- if ([UIAppDelegate.coordinateFunctions spritesCollided:bullet sprite2:attacker]) {
- [attacker deathSequence];
- [bulletsToDestroy addObject:bullet];
- }
+ if ([attacker alive]) {
+ if ([UIAppDelegate.coordinateFunctions spritesCollided:bullet sprite2:attacker]) {
+ [attacker deathSequence];
+ [bulletsToDestroy addObject:bullet];
+ }
+ }
}
for (Attacker *attacker in attackersToDestroy) {
[attackers removeObject:attacker];

0 comments on commit fe55995

Please sign in to comment.
Something went wrong with that request. Please try again.