Example #1
0
        private void HandleMouseInput(InputState input)
        {
            if (input.LastMouseState.RightButton == ButtonState.Released && input.CurrentMouseState.RightButton == ButtonState.Pressed)
            {
                Vector2 point   = new Vector2(input.CurrentMouseState.X, input.CurrentMouseState.Y);
                Grenade grenade = new Grenade(point, PhysicsSimulator);
                grenade.Load(_grenadeTexture);
                grenade.OnTimeout += Grenade_OnTimeout;

                _grenades.Add(grenade);
            }

            if (input.CurrentMouseState.LeftButton == ButtonState.Pressed)
            {
                Vector2 point = new Vector2(input.CurrentMouseState.X, input.CurrentMouseState.Y);
                _hairDryer.Position = point;
            }
        }
Example #2
0
        private void HandleMouseInput(InputState input)
        {
            if (input.LastMouseState.RightButton == ButtonState.Released && input.CurrentMouseState.RightButton == ButtonState.Pressed)
            {
                Vector2 point = new Vector2(input.CurrentMouseState.X, input.CurrentMouseState.Y);
                Grenade grenade = new Grenade(point, PhysicsSimulator);
                grenade.Load(_grenadeTexture);
                grenade.OnTimeout += Grenade_OnTimeout;

                _grenades.Add(grenade);
            }

            if (input.CurrentMouseState.LeftButton == ButtonState.Pressed)
            {
                Vector2 point = new Vector2(input.CurrentMouseState.X, input.CurrentMouseState.Y);
                _hairDryer.Position = point;
            }
        }