示例#1
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);
        }
示例#2
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);
        }
示例#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)
        {
            base.Update(gameTime);

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

            if (GameKeyboard.IsKeyPressed(Microsoft.Xna.Framework.Input.Keys.G))
            {
                Settings.ShowCollidingBoxes = !Settings.ShowCollidingBoxes;
            }
        }
示例#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)
        {
            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);
        }