Esempio n. 1
0
        private void Grenade_OnTimeout(Grenade sender, Vector2 position)
        {
            //Remember to remove event registations or the GC will not collect it.
            sender.OnTimeout -= Grenade_OnTimeout;

            //Remove from update/drawing list
            _grenades.Remove(sender);
        }
Esempio n. 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;
            }
        }
Esempio n. 3
0
 void Grenade_OnTimeout(Grenade sender, Vector2 position)
 {
     ApplyExplosion(position);
 }
Esempio n. 4
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;
            }
        }
Esempio n. 5
0
        private void Grenade_OnTimeout(Grenade sender, Vector2 position)
        {
            //Remember to remove event registations or the GC will not collect it.
            sender.OnTimeout -= Grenade_OnTimeout;

            //Remove from update/drawing list
            _grenades.Remove(sender);
        }
Esempio n. 6
0
 void Grenade_OnTimeout(Grenade sender, Vector2 position)
 {
     ApplyExplosion(position);
 }