Inheritance: IDrawable, IUpdateable
Ejemplo n.º 1
0
        /// <summary>
        /// Called if the scene is activated.
        /// </summary>
        public override void OnSceneActivated()
        {
            _blackBlend = new BlackBlend {IsEnabled = true, FadeIn = false};

            #if AUDIO_ENABLED
               // AudioManager.Instance.Sound.Play(SGL.QueryResource<Sound>("menuMusic.mp3"), PlayMode.Loop);
            #endif
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Called if the scene is activated.
        /// </summary>
        public override void OnSceneActivated()
        {
            _entityComposer = new EntityComposer();
            _scoreBoard = new Scoreboard();
            _debugDisplay = new DebugDisplay(_entityComposer) {Visible = false};
            _minimap = new Minimap(_entityComposer);
            _blackBlend = new BlackBlend {FadeIn = true};

            //load achievements

            var xmlManager = new XmlManager<AchievementManager>();
            try
            {
                _entityComposer.AchievementManager =
                    xmlManager.Load(Path.Combine(Environment.CurrentDirectory, "achievements.xml"));
            }
            catch
            {
                _entityComposer.AchievementManager = new AchievementManager();
                _entityComposer.AchievementManager.Achievements.Add(new EnemyDestroyedAchievement());
                _entityComposer.AchievementManager.Achievements.Add(new ScoreAchievement());
                _entityComposer.AchievementManager.Achievements.Add(new SustainAchievement());
                _entityComposer.AchievementManager.Achievements.Add(new LasterTimeAchievement());
                System.Diagnostics.Debug.WriteLine("Unable to load achievements.");
            }

            _achievementControl = new AchievementControl(UIManager);
            _achievementControl.Visible = false;
            _achievementsOpen = false;
            _achievementControl.AchievementManager = _entityComposer.AchievementManager;

            #if AUDIO_ENABLED
            //AudioManager.Instance.Sound.Play(SGL.QueryResource<Sound>("gameMusic.mp3"), PlayMode.Loop);
            #endif
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes the scene.
 /// </summary>
 public override void Initialize()
 {
     _blackBlend = new BlackBlend {FadeIn = true, IsEnabled = true};
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Called if the scene is activated.
        /// </summary>
        public override void OnSceneActivated()
        {
            _blackBlend = new BlackBlend {FadeIn = false, IsEnabled = true};

            if (AchievementManager != null)
            {
                var xmlManager = new XmlManager<AchievementManager>();
                xmlManager.Save(Path.Combine(Environment.CurrentDirectory, "achievements.xml"), AchievementManager);
            }
        }