예제 #1
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)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                GameState.IsShowMainMenuScene = true;
            }

            // TODO: Add your update logic here
            InputManager.Update();
            if (GameState.IsShowMainMenuScene)
            {
                menuScene.Update();
            }
            else if (GameState.IsShowGameScene)
            {
                gameScene.Update();
            }
            else if (GameState.IsRankingScene)
            {
                rankingScene.Update();
            }
            else if (GameState.IsPlayerNameScene)
            {
                playerNameScene.Update();
            }

            base.Update(gameTime);
        }
예제 #2
0
        /// <summary>
        /// Main update loop of the game
        /// </summary>
        /// <param name="gameTime"></param>
        protected override void Update(GameTime gameTime)
        {
            switch (_gameState)
            {
            case GameState.MainMenu:
                Menu.Update(gameTime);
                break;

            case GameState.LoggedIn:
                CharacterSelect.Update(gameTime);
                break;

            case GameState.RegisterAccount:
                RegisterAccount.Update(gameTime);
                break;

            case GameState.CreateCharacter:
                CharacterCreate.Update(gameTime);
                break;

            case GameState.Playing:
                GameScence.Update(gameTime);
                break;
            }

            base.Update(gameTime);
        }
예제 #3
0
        internal override void Update(GameTime gameTime)
        {
            switch (Data.currentState)
            {
            case Data.GameStates.Menu:
                ms.Update(gameTime);
                break;

            case Data.GameStates.Game:
                break;

            case Data.GameStates.Settings:
                break;
            }
        }
예제 #4
0
파일: Game1.cs 프로젝트: Oskkar/Games
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                Exit();
            }

            if (Menu.IsShowMainMenuScene)
            {
                menuScene.Update(gameTime);
            }
            if (Menu.IsShowGameScene)
            {
                gameScene.Update(gameTime);
            }

            base.Update(gameTime);
        }