Inheritance: IDrawable, IUpdateable
コード例 #1
0
ファイル: MenuScene.cs プロジェクト: ThuCommix/Sharpex2D
        /// <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
        }
コード例 #2
0
ファイル: GameScene.cs プロジェクト: ThuCommix/Sharpex2D
        /// <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
        }
コード例 #3
0
ファイル: IntroScene.cs プロジェクト: ThuCommix/Sharpex2D
 /// <summary>
 /// Initializes the scene.
 /// </summary>
 public override void Initialize()
 {
     _blackBlend = new BlackBlend {FadeIn = true, IsEnabled = true};
 }
コード例 #4
0
ファイル: EndScene.cs プロジェクト: ThuCommix/Sharpex2D
        /// <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);
            }
        }