Example #1
0
        public void Spawn(int number, float x, float y, float z, float xi, float yi, float zi)
        {
            Random rnd = new Random(Environment.TickCount);

            for (int i = 0; i < number; i++)
            {
                foreach (ParticleBase pbase in Bases)
                {
                    ParticleBase np = pbase.Clone();

                    np.W = W + rnd.Next(-( int )WJit / 2, ( int )WJit / 2);
                    np.H = H + rnd.Next(-( int )HJit / 2, ( int )HJit / 2);

                    np.X = x + rnd.Next(( int )-XSmall, ( int )XBig);
                    np.Y = y + rnd.Next(( int )-YSmall, ( int )YBig);

                    float zd = ZBig - ZSmall;

                    zd = zd * ( float )rnd.NextDouble( );

                    np.Z = z + zd;

                    np.Rot = rnd.Next(( int )SpawnRot1, ( int )SpawnRot2);

                    float xj = XIJit * (float)rnd.NextDouble();
                    float yj = YIJit * (float)rnd.NextDouble();
                    float zj = ZIJit * (float)rnd.NextDouble();

                    if (rnd.Next(0, 5) > 2)
                    {
                        xj = -xj;
                    }
                    if (rnd.Next(0, 5) > 2)
                    {
                        yj = -yj;
                    }
                    if (rnd.Next(0, 5) > 2)
                    {
                        zj = -zj;
                    }

                    float pw = (PowerBig - PowerSmall) * (float)rnd.NextDouble();

                    pw = PowerSmall + pw;

                    np.XI = (xi + xj) * pw;
                    np.YI = (yi + yj) * pw;
                    np.ZI = (zi + zj) * pw;

                    np.RI = rnd.Next(( int )-RJit, ( int )RJit);

                    //np.Life = 100.0f;
                    np.LifeRate = 0.03f;
                    np.LifeDrag = 0.98f;
                    np.Sys      = this;

                    Particles.Add(np);
                }
            }
        }
Example #2
0
 public void AddBase(ParticleBase pbase)
 {
     Bases.Add(pbase);
 }
Example #3
0
 public void Remove(ParticleBase particle)
 {
     Removes.Add(particle);
 }