public void CheckForCollisions(Display scoreBoard) { for (int i = 0; i < playerShots.numberOfShots(); i++) { for (int j = 0; j < invaders.Count(); j++) { if (invaders.ElementAt <Invader>(j).Area.Contains(playerShots.ElementAt(i).Area) == true) { playerShots.Remove(i); scoreBoard.Score = invaders.ElementAt <Invader>(j).Score; invaders.RemoveAt(j); InvadersLeft = -1; break; } } } }
public bool CheckForCollisions() { for (int i = 0; i < enemyShots.numberOfShots(); i++) { if (Area.Contains(enemyShots.ElementAt(i).Area) == true) { Alive = false; enemyShots.Remove(i); return(Alive); } else { Alive = true; } } return(Alive); }