Пример #1
0
        private void Close()
        {
            var transitionScreen = new FadeTransitionScreen(this, _preScreen, FADE_OUT_SPEED);

            transitionScreen.LoadContent();
            GetComponent <ScreenManager>().SetScreen(transitionScreen);
        }
Пример #2
0
        internal override void Update(GameTime gameTime)
        {
            if (_currentFrame < FRAMES_TOTAL - 1)
            {
                if (_currentFrame > 80)
                {
                    _currentFrame += FRAME_SPEED / 1.5f;
                }
                else
                {
                    _currentFrame += FRAME_SPEED;
                }
                if (_currentFrame >= FRAMES_TOTAL - 1)
                {
                    _currentFrame = FRAMES_TOTAL - 1;
                }
            }
            else
            {
                _endDelay--;
                if (_endDelay == 0)
                {
                    var titleScreen = new TitleScreen();
                    titleScreen.LoadContent();

                    var transitionScreen = new FadeTransitionScreen(this, titleScreen, 0.1f);
                    transitionScreen.LoadContent();

                    GetComponent <ScreenManager>().SetScreen(transitionScreen);
                }
            }
        }
Пример #3
0
        private void NewGame()
        {
            var newGameScreen = new NewGameScreen();

            newGameScreen.LoadContent();

            var transitionScreen = new FadeTransitionScreen(this, newGameScreen, 0.05f);

            transitionScreen.LoadContent();

            GetComponent <ScreenManager>().SetScreen(transitionScreen);
        }
Пример #4
0
        private void ContinueGame(GameTime gameTime)
        {
            var worldScreen = new WorldScreen();

            worldScreen.LoadContent();
            // update the world screen once to properly load the player entity
            worldScreen.Update(gameTime);

            var transitionScreen = new FadeTransitionScreen(this, worldScreen, 0.02f);

            transitionScreen.LoadContent();

            GetComponent <ScreenManager>().SetScreen(transitionScreen);
        }