예제 #1
0
        /// <summary>
        /// checks if any buttons are clicked and does the appropriate action
        /// </summary>
        public static void Update()
        {
            //check if back to game button was clicked
            if (backToGameBtn.Update())
            {
                //go to game scene
                TankGame.State = GameState.Game;
            }

            //check if bakc to menu button was clicked
            if (backToMenuBtn.Update())
            {
                //reset the game and the shop
                GameScene.Reset();
                Shop.Reset();

                //go to game scene
                TankGame.State = GameState.Menu;
            }
        }
예제 #2
0
        /// <summary>
        /// Updates the state from the user input.
        /// </summary>
        public static void Update()
        {
            //check wether play again button was clicked
            if (playAgainBtn.Update())
            {
                //go to game scene
                TankGame.State = GameState.Game;

                //reset game and shop scene
                GameScene.Reset();
                Shop.Reset();
            }

            //chekc if back to menu button is pressed
            if (backToMenuBtn.Update())
            {
                //go to menu scene
                TankGame.State = GameState.Menu;

                //reset game and shop scene
                GameScene.Reset();
                Shop.Reset();
            }
        }