Exemplo n.º 1
0
 public override void Shoot()
 {
     if (this.Time % 20 != 0)
     {
         return;
     }
     for (int index = 0; index < 3; ++index)
     {
         StageDataPackage stageData = this.StageData;
         MyRandom         ran1      = this.Ran;
         Rectangle        boundRect = this.BoundRect;
         int left = boundRect.Left;
         boundRect = this.BoundRect;
         int      right = boundRect.Right;
         double   num1  = (double)ran1.Next(left, right);
         MyRandom ran2  = this.Ran;
         boundRect = this.BoundRect;
         int top = boundRect.Top;
         boundRect = this.BoundRect;
         int          maxValue     = boundRect.Bottom / 3;
         double       num2         = (double)ran2.Next(top, maxValue);
         PointF       Position     = new PointF((float)num1, (float)num2);
         double       num3         = (double)this.Ran.Next(10, 20) / 10.0;
         double       Diretion     = Math.PI / 2.0 + 0.5 * this.Ran.NextDouble();
         ParticleBack particleBack = new ParticleBack(stageData, "snow", Position, (float)num3, Diretion);
         particleBack.LifeTime        = 200;
         particleBack.AngularVelocity = (float)this.Ran.Next(20) / 1000f;
         particleBack.Scale           = (float)this.Ran.Next(2, 10) / 10f;
         particleBack.Active          = true;
     }
 }
Exemplo n.º 2
0
 public override void Shoot()
 {
     if (this.Time % 3 != 0)
     {
         return;
     }
     for (int index = 0; index < 5; ++index)
     {
         double       num1          = (double)this.Ran.Next(360) / 180.0 * Math.PI;
         int          num2          = this.Ran.Next(150, 200);
         ParticleBack particleBack1 = new ParticleBack(this.StageData, "snow", new PointF(this.Position.X + (float)num2 * (float)Math.Cos(num1), this.Position.Y + (float)num2 * (float)Math.Sin(num1)), 0.0f, num1 + Math.PI);
         particleBack1.AngularVelocity   = (float)this.Ran.Next(10) / 100f;
         particleBack1.TransparentValueF = 200f;
         particleBack1.LifeTime          = this.Ran.Next(30, 50);
         particleBack1.Scale             = (float)this.Ran.Next(80, 100) / 100f;
         ParticleBack particleBack2 = particleBack1;
         particleBack2.Velocity = (float)num2 / (float)particleBack2.LifeTime;
     }
 }