Ejemplo n.º 1
0
        void GameStop(bool complete)
        {
            if (gameTime == 0)
            {
                return;
            }

            gameTime = 0;

            if (complete)
            {
                GameEngineApp.Instance.ControlManager.PlaySound("Sounds/Feedback/Complete.ogg");
                level++;
            }

            //Destroy all alive enemies
            ttt :;
            foreach (Entity entity in Map.Instance.Children)
            {
                if (entity.IsSetForDeletion)
                {
                    continue;
                }

                Unit unit = entity as Unit;
                if (unit == null)
                {
                    continue;
                }

                if ((unit.Intellect as AI) != null)
                {
                    unit.Die();
                    goto ttt;
                }
            }

            //restore default music
            if (GameMap.Instance != null)
            {
                GameMusic.MusicPlay(GameMap.Instance.GameMusic, true);
            }

            if (complete && level > 4)
            {
                UpdateVictoryObjects(true);
            }
        }