Update() private méthode

private Update ( ) : void
Résultat void
        /// <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)
        {
            // Allows the game to exit
            if (xInput.GamePad.GetState(PlayerIndex.One).Buttons.Back == xInput.ButtonState.Pressed)
            {
                Application.Current.Exit();
            }

#if WINDOWS_APP
            var keyboardState = Microsoft.Xna.Framework.Input.Keyboard.GetState();
            //if (keyboardState.IsKeyUp())
#endif

#if WINDOWS_PHONE_APP
            if (screenPad.GetState().Buttons.B == ButtonState.Pressed)
            {
                buttonBPressed = true;
            }
            else if (screenPad.GetState().Buttons.B == ButtonState.Released && buttonBPressed)
            {
                buttonBPressed = false;
                var reviewHelper = BaseVerticalShooter.Resolver.Instance.Resolve <IReviewHelper>();
                reviewHelper.MarketPlaceReviewTask();
            }

            screenPad.Update();
#endif

            currentView.Update(gameTime);

            base.Update(gameTime);
        }
Exemple #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)
        {
            // Allows the game to exit
            if (xInput.GamePad.GetState(PlayerIndex.One).Buttons.Back == xInput.ButtonState.Pressed)
            {
                this.Exit();
            }

            if (screenPad.GetState().Buttons.B == ButtonState.Pressed)
            {
                buttonBPressed = true;
            }
            else if (screenPad.GetState().Buttons.B == ButtonState.Released && buttonBPressed)
            {
                buttonBPressed = false;
                //MarketplaceReviewTask marketplaceReviewTask = new MarketplaceReviewTask();
                //marketplaceReviewTask.Show();
            }

            screenPad.Update();
            currentView.Update(gameTime);

            base.Update(gameTime);
        }