Ejemplo n.º 1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            gameScreenManager = new GameScreenManager(this);

            base.Initialize();
        }
Ejemplo n.º 2
0
        public override GameScreenManager.ScreenTransition Update(GameTime gameTime, GameScreenManager gameScreenManager)
        {
            base.Update(gameTime, gameScreenManager); //Do NOT use the return value from here!

            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                return(GameScreenManager.ScreenTransition.CombatToExit);
            }
            if (previousKeyboardState != currentKeyboardState)
            {
                if (currentKeyboardState.IsKeyDown(Keys.M))
                {
                    boardManager.Move();
                }

                if (currentKeyboardState.IsKeyDown(Keys.Up) || currentGamePadState.IsButtonDown(Buttons.LeftThumbstickUp))
                {
                    boardManager.MoveUp();
                }
                else if (currentKeyboardState.IsKeyDown(Keys.Down) || currentGamePadState.IsButtonDown(Buttons.LeftThumbstickDown))
                {
                    boardManager.MoveDown();
                }
                else if (currentKeyboardState.IsKeyDown(Keys.Left) || currentGamePadState.IsButtonDown(Buttons.LeftThumbstickLeft))
                {
                    boardManager.MoveLeft();
                }
                else if (currentKeyboardState.IsKeyDown(Keys.Right) || currentGamePadState.IsButtonDown(Buttons.LeftThumbstickRight))
                {
                    boardManager.MoveRight();
                }

                if ((currentKeyboardState.IsKeyDown(Keys.Tab) && (currentKeyboardState.IsKeyDown(Keys.LeftShift) || currentKeyboardState.IsKeyDown(Keys.RightShift))) || currentGamePadState.IsButtonDown(Buttons.DPadLeft))
                {
                    boardManager.PreviousUnit();
                }
                else if (currentKeyboardState.IsKeyDown(Keys.Tab) || currentGamePadState.IsButtonDown(Buttons.DPadRight))
                {
                    boardManager.NextUnit();
                }

                if (currentKeyboardState.IsKeyDown(Keys.Enter))
                {
                    boardManager.EndTurn();
                }
            }

            if (boardManager.CheckWinConditions(gameTime) != null)
            {
                return(GameScreenManager.ScreenTransition.CombatToWin);
            }


            boardManager.Update(gameTime);
            sideInfoManager.Update(gameTime);

            return(GameScreenManager.ScreenTransition.NoChange);
        }
Ejemplo n.º 3
0
        public virtual GameScreenManager.ScreenTransition Update(GameTime gameTime, GameScreenManager gameScreenManager)
        {
            previousKeyboardState = currentKeyboardState;
            currentKeyboardState  = Keyboard.GetState();
            previousGamePadState  = currentGamePadState;
            currentGamePadState   = GamePad.GetState(PlayerIndex.One);

            return(GameScreenManager.ScreenTransition.NoChange);
        }
Ejemplo n.º 4
0
        public override GameScreenManager.ScreenTransition Update(GameTime gameTime, GameScreenManager gameScreenManager)
        {
            base.Update(gameTime, gameScreenManager); //Do NOT use the return value from here!

            if (previousKeyboardState != currentKeyboardState)
            {
                if (currentKeyboardState.IsKeyDown(Keys.Enter))
                {
                    return(GameScreenManager.ScreenTransition.WinToMenu);
                }
                if (currentKeyboardState.IsKeyDown(Keys.Space))
                {
                    return(GameScreenManager.ScreenTransition.WinToMenu);
                }
            }
            return(GameScreenManager.ScreenTransition.NoChange);
        }
Ejemplo n.º 5
0
        public override GameScreenManager.ScreenTransition Update(GameTime gameTime, GameScreenManager gameScreenManager)
        {
            base.Update(gameTime, gameScreenManager); //Do NOT use the return value from here!

            if (previousKeyboardState != currentKeyboardState)
            {
                if (currentKeyboardState.IsKeyDown(Keys.Up) || currentGamePadState.IsButtonDown(Buttons.LeftThumbstickUp))
                {
                }
                else if (currentKeyboardState.IsKeyDown(Keys.Down) || currentGamePadState.IsButtonDown(Buttons.LeftThumbstickDown))
                {
                }
                if (currentKeyboardState.IsKeyDown(Keys.Enter))
                {
                    return(GameScreenManager.ScreenTransition.MenuToExit);
                }
                if (currentKeyboardState.IsKeyDown(Keys.Space))
                {
                    return(GameScreenManager.ScreenTransition.MenuToCombat);
                }
            }
            return(GameScreenManager.ScreenTransition.NoChange);
        }