Beispiel #1
0
        void UpdateParticles(float time)
        {
            if (earth.NumOfParticles == 0)
            {
                SetupParticles(true, false, false);
            }
            if (explosion.NumOfParticles == 0)
            {
                SetupParticles(false, true, false);
            }
            earth.Update(time);
            explosion.Update(time);

            if (smoke.NumOfParticles < PART + 100)
            {
                Vector3 pos       = new Vector3(0, 5 + (float)(Rnd.NextDouble() * 5), 0);
                Vector3 dir       = new Vector3(-0.05f + (float)(Rnd.NextDouble() * 0.1f), 0.2f, -0.05f + (float)(Rnd.NextDouble() * 0.1f));
                Vector3 grav      = new Vector3(0, 0, 0);
                float   life      = 3;
                float   size      = (float)Rnd.NextDouble() + 0.5f;
                float   zrot      = (float)(Rnd.NextDouble() * 360);
                float   zrotAdder = (float)(Rnd.NextDouble());
                smoke.AddParticle(ref pos, ref dir, ref grav, life, zrot, zrotAdder, size, new Vector4(0.5f, 0.5f, 0.5f, 0.1f));
            }
            smoke.Update(time);
        }
Beispiel #2
0
        void UpdateParticles(float time)
        {
            if (explosion.NumOfParticles == 0)
            {
                explosion.Reset();
            }
            explosion.Update(time);

            smoke.ResetOneParticle();
            smoke.Update(time);
        }