示例#1
0
        protected override void TriggerParticals(Vector2 pos, int amount)
        {
            for (int i = 0; i < amount; i++)
            {
                Partical p = GenerateParticalProperties(
                    Vector2.Transform(new Vector2(_random.Next(0, (int)Radius), 0),
                                      Matrix.CreateRotationZ((float)_random.NextDouble() * MathHelper.TwoPi)));
                switch (Function)
                {
                case EmmiterFunction.Explosive:
                    p.Velocity = p.Position;
                    p.Velocity.Normalize();
                    p.Velocity *= ParticalSpeed.GetValue();
                    break;

                case EmmiterFunction.Implosive:
                    p.Velocity = -p.Position;
                    p.Velocity.Normalize();
                    p.Velocity *= ParticalSpeed.GetValue();
                    break;
                }
                p.Position = p.Position + pos;
                Particals.Add(p);
            }
        }
示例#2
0
 protected override void TriggerParticals(Vector2 pos, int amount)
 {
     for (int i = 0; i < amount; i++)
     {
         Particals.Add(GenerateParticalProperties(
                           new Vector2(_random.Next(Area.X, Area.X + Area.Width) + pos.X,
                                       _random.Next(Area.Y, Area.Y + Area.Height) + pos.Y)
                           ));
     }
 }