Beispiel #1
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);
        }