public void KillThePlayer() { PlayerBlock player = Blocks.OfType <PlayerBlock>().FirstOrDefault(); if (player != null) { player.ExplodeNeighbour(Directions.None); } }
public bool UpdatePlayer(Directions playerDirection) { PlayerBlock player = Blocks.OfType <PlayerBlock>().FirstOrDefault(); if (player != null) { player.UpdatePosition(this, playerDirection); } if (HeartsToComplete == HeartsTaken) { this.Blocks.OfType <ExitBlock>().ToList().ForEach(e => e.levelOpen()); } return(true); }