예제 #1
0
        /// <summary>
        /// Allows the screen to run updating logic like checking user inputs,
        /// changing item properties or playing music
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            var state = KeyboardController.GetState();

            if (state.IsKeyDown(Keys.Escape, true))
            {
                this.PopScreen();
            }
        }
예제 #2
0
        /// <summary>
        /// Allows the screen to run updating logic like checking user inputs,
        /// changing item properties or playing music
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            if (gameTime != null)
            {
                var state = KeyboardController.GetState();
                if (state.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Escape, true))
                {
                    this.PopScreen();
                }

                base.Update(gameTime);
            }
        }
예제 #3
0
        /// <summary>
        /// Allows the screen to run updating logic like checking user inputs,
        /// changing item properties or playing music
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            if (gameTime != null)
            {
                var ks = KeyboardController.GetState();

                if (ks.IsKeyDown(Keys.Escape, true))
                {
                    this.PopScreen();
                }

                base.Update(gameTime);
            }
        }
예제 #4
0
        /// <summary>
        /// Allows the screen to run updating logic like checking user inputs,
        /// changing item properties or playing music
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public override void Update(GameTime gameTime)
        {
            if (gameTime != null)
            {
                var state = KeyboardController.GetState();

                // Control debug view
                if (this.debugView != null && state.IsKeyDown(Keys.F1, true))
                {
                    if ((this.debugView.Flags & DebugViewFlags.Shape) == DebugViewFlags.Shape)
                    {
                        this.debugView.RemoveFlags(DebugViewFlags.Shape);
                    }
                    else
                    {
                        this.debugView.AppendFlags(DebugViewFlags.Shape);
                    }

                    this.showDebugView = !this.showDebugView;
                }

                if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || state.IsKeyDown(Keys.Escape, true))
                {
                    this.PopScreen();
                }

                if (state.IsKeyDown(Keys.P))
                {
                    ScreenManager.AddScreen(Enums.SystemScreen.PauseScreen);
                }

                this.World.Step((float)gameTime.ElapsedGameTime.TotalMilliseconds * 0.001f);

                this.map.Update(gameTime);
                this.Camera.Rotation = this.ScreenRotation;
                this.Camera.CenterOnFollowing();
            }

            base.Update(gameTime);
        }