void TestBombCollision() { if (TheMan.Died) { NumberOfMen--; if (NumberOfMen == 0) { TheHighScore.Write(TheScore.Count); TheScore.GameOver = true; GameGoing = false; } else { TheMan.Reset(); ResetAllBombCounters(); } } if (TheMan.BeenHit == true) { return; } for (int i = 0; i < kNumberOfRows; i++) { TheInvaders = InvaderRows[i]; for (int j = 0; j < TheInvaders.Invaders.Length; j++) { for (int k = 0; k < kNumberOfShields; k++) { bool bulletHole = false; if (Shields[k].TestCollision(TheInvaders.Invaders[j].GetBombBounds(), true, out bulletHole)) { TheInvaders.Invaders[j].ResetBombPosition(); Invalidate(Shields[k].GetBounds()); } if (Shields[k].TestCollision(TheBullet.GetBounds(), false, out bulletHole)) { ActiveBullet = false; Invalidate(Shields[k].GetBounds()); TheBullet.Reset(); } } if (TheInvaders.Invaders[j].IsBombColliding(TheMan.GetBounds())) { TheMan.BeenHit = true; PlaySoundInThread("2.wav", 1); } } } }