Beispiel #1
0
        public override void Update(GameTime gameTime)
        {
            _pauseGameLayout.Update(gameTime);

            if (Enabled == false)
            {
                return;
            }

            if (TSInputHandler.KeyboardState.IsKeyDown(Keys.Escape))
            {
                this.Enabled              = false;
                _pauseGameLayout.Enabled  = true;
                _pauseGameLayout.Visibled = true;
            }


            _map.Update(gameTime);

            MouseState ms = TSInputHandler.MouseState;

            if (ms.LeftButton == ButtonState.Pressed)
            {
                mainWarrior.MoveTo(ms.X + _map.P0.X, ms.Y + _map.P0.Y);
            }

            mainWarrior.Update(gameTime);
            base.Update(gameTime);
        }
Beispiel #2
0
        public override void Update(GameTime gameTime)
        {
            MouseState ms = TSInputHandler.MouseState;

            int d = 10;

            if (ms.X < d)
            {
                map.Move(-5, 0);
            }
            else if ((this.Width - d) <= ms.X && ms.X < this.Width)
            {
                map.Move(5, 0);
            }
            else if (ms.Y < d)
            {
                map.Move(0, -5);
            }
            else if ((this.Height - d) <= ms.Y && ms.Y < this.Height)
            {
                map.Move(0, 5);
            }

            if (ms.LeftButton == ButtonState.Pressed)
            {
                blue.MoveTo(ms.X, ms.Y);
            }

            map.Update(gameTime);
            blue.Update(gameTime);
            base.Update(gameTime);
        }