Example #1
0
        private void MouseEvents_OnMousePress(Point p)
        {
            foreach (Tile t in Game1.getCurrentList())
            {
                if (t.getRecHit().Contains(MouseEvents.getMousePos()))
                {
                    setSelected(t);
                }
            }
            if (selected == null)
            {
                return;
            }

            if (UL.Contains(p))
            {
                ULDrag     = true;
                pressPoint = p;
                recBefore  = selected.getRecHit();
            }
            else if (DR.Contains(p))
            {
                DRDrag     = true;
                pressPoint = p;
                recBefore  = selected.getRecHit();
            }
            else if (selected.getRecHit().Contains(p))
            {
                Move       = true;
                pressPoint = p;
                recBefore  = selected.getRecHit();
            }
        }
Example #2
0
        protected override void Update(GameTime gameTime)
        {
            MouseEvents.Update();
            camera.Update();
            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                this.Exit();
            }

            base.Update(gameTime);
        }