예제 #1
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            MusicManager.Update();

            GameMouse.Update(gameTime);
            Camera.Update(gameTime);

            foreach (BaseScreen screen in ScreensToAdd)
            {
                Screens.Add(screen);
            }

            ScreensToAdd.Clear();

            foreach (BaseScreen screen in Screens)
            {
                // Update before handling input - otherwise if we select something the WhileSelected method will be called straightaway, which is usually undesired
                if (screen.Active)
                {
                    screen.Update(gameTime);
                }
            }

            foreach (BaseScreen screen in ScreensToRemove)
            {
                Screens.Remove(screen);
            }

            ScreensToRemove.Clear();
        }
예제 #2
0
파일: Game1.cs 프로젝트: Oyyou/Flounchy
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            GameMouse.Update(gameTime);
            GameKeyboard.Update(gameTime);

            _homeStateGUI.Update(gameTime);

            base.Update(gameTime);
        }
예제 #3
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            GameMouse.Update();
            GameKeyboard.Update();

            _state.Update(gameTime);

            base.Update(gameTime);
        }
예제 #4
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            GameMouse.Update();
            GameKeyboard.Update();

            _battleGUI.Update(gameTime, new System.Collections.Generic.List <Lib.Models.UnitModel>());

            base.Update(gameTime);
        }
예제 #5
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            GameKeyboard.Update(gameTime);
            GameMouse.Update(gameTime);

            if (GameKeyboard.IsKeyPressed(Microsoft.Xna.Framework.Input.Keys.G))
            {
                Settings.ShowCollidingBoxes = !Settings.ShowCollidingBoxes;
            }
        }
예제 #6
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            GameMouse.Update(gameTime);
            GameKeyboard.Update(gameTime);

            switch (_currentState)
            {
            case RoamingState roamingState:

                //if (roamingState.EnterBattle)
                //{
                //  roamingState.EnterBattle = false;

                //  _transition.Start();
                //}

                //if (_transition.State == Transition.States.Middle)
                //{
                //  _currentState = new BattleState(_gameModel, _players);
                //  _currentState.LoadContent();
                //}

                break;

            //case BattleState battleState:

            //  if (battleState.BattleFinished)
            //  {
            //    if (!(_transition is FourCornersTransition))
            //      _transition = new FourCornersTransition(_gameModel);
            //    _transition.Start();
            //  }

            //  if (_transition.State == Transition.States.Middle)
            //  {
            //    _currentState = new AfterBattleState(_gameModel, _players);
            //    _currentState.LoadContent();
            //  }

            //  break;

            //case AfterBattleState afterBattleState:

            //  if (afterBattleState.Continue)
            //  {
            //    _transition.Start();
            //  }

            //  if (_transition.State == Transition.States.Middle)
            //  {
            //    _currentState = new RoamingState(_gameModel, _players);
            //    _currentState.LoadContent();
            //  }

            //  break;

            case OpeningState openingState:

                if (openingState.State == OpeningState.States.Fade)
                {
                    _transition.Start();
                }

                if (_transition.State == Transition.States.Middle)
                {
                    _currentState = new BattleState(_gameModel, _players, new List <string>()
                    {
                        "Glenda: Any reason why you're completely nude, and surrounded by vampire snakes?",
                        "Nude man: A really fun night I guess..?",
                        "Glenda: Uugh. Just kill them!",
                    });
                    _currentState.LoadContent();
                }

                break;

            default:
                //throw new Exception("Unexpected state: " + _currentState.ToString());
                break;
            }

            _transition.Update(gameTime);
            _currentState.Update(gameTime);

            base.Update(gameTime);
        }