Exemple #1
0
        private void HandleInputs()
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            if (Mouse.GetState().LeftButton == ButtonState.Pressed && GraphicsDevice.Viewport.Bounds.Contains(MousePosition))
            {
                Vector2 clickPos = Mouse.GetState().Position.ToVector2() + Camera.TopLeftPos;
                Player.MoveToPosition(clickPos);
                movePointer.SetPos(clickPos - new Vector2(movePointer.GetWidth() / 2, movePointer.GetHeight() / 2));
            }
        }