Beispiel #1
0
        /// <summary>
        /// Initializes the intro by making it ready to run and runs it
        /// </summary>
        /// <returns>returns an instance of game</returns>
        public IntroScreen InitializeIntro()
        {
            _intro = new IntroController(_game);
            _intro.Exit += EndIntro;
            ChildComponents.Add(_intro);
            StateManager.PushState(this);
            AudioController.PauseAll();
            AudioController.RequestTrack("intro");

            return this;
        }
Beispiel #2
0
        /// <summary>
        /// Updates the game logic
        /// </summary>
        /// <param name="gameTime">provides a snapshot of the game logic</param>
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            if(_introFlaggedForRemoval)
            {
                StateManager.PopState();
                ChildComponents.Remove(_intro);
                AudioController.RequestTrack("intro").Stop();
                if (AudioController.RequestTrack("pallet").State == SoundState.Playing)
                    AudioController.RequestTrack("pallet").IsLooped = true;
                AudioController.RequestTrack("pallet").Play();
                _intro = null;
                _introFlaggedForRemoval = false;
            }
        }