Exemplo n.º 1
0
 private void onWhenSpacehipDie(TextAsSprite i_ScoreAsText)
 {
     SettingsManager.AddPlayerScore(i_ScoreAsText);
     if (SpaceShips.Where(spaceShip => spaceShip.Value.Enabled).Count() == 0)
     {
         if (NotifiyGameOver != null)
         {
             NotifiyGameOver();
         }
     }
 }
Exemplo n.º 2
0
        private void setNumberOfPlayers()
        {
            int i = SpaceShips.Where(spaceShip => spaceShip.Value.Enabled).Count();

            if (PlayersCount > SpaceShips.Where(spaceShip => spaceShip.Value.Enabled).Count())
            {
                SpaceShips["SpaceShip2"].Enabled   = SpaceShips["SpaceShip2"].Visible = true;
                SpaceShips["SpaceShip2"].WhenIDie += onWhenSpacehipDie;
                SpaceShips["SpaceShip2"].Add();
            }
            else
            {
                SpaceShips["SpaceShip2"].Enabled   = SpaceShips["SpaceShip2"].Visible = false;
                SpaceShips["SpaceShip2"].WhenIDie -= onWhenSpacehipDie;
                SpaceShips["SpaceShip2"].Remove();
            }
        }