Beispiel #1
0
 public void Update(GameTime gameTime, List <SimpleParticle> particleList, ParticleSystem sps, Vector3 pos, float particleVelocity)
 {
     timer++;
     if (timer >= timerMax)//changes the rete the particles appear
     {
         if (ParticleSystem.MaxParticles > particleList.Count)
         {
             float          maxVel = particleVelocity; //0.6f;
             SimpleParticle p      = new SimpleParticle();
             p.Init();
             p.Position = position;
             p.velocity = new Vector3((float)random.NextDouble() * maxVel, Math.Abs((float)random.NextDouble()) * 3.0f, (float)random.NextDouble() * maxVel);
             p.Texture  = sps.Texture;
             p.Effect   = sps.Effect;
             particleList.Add(p);
         }
         timer = 0;
     }
 }
Beispiel #2
0
 public void Update(GameTime gameTime, List<SimpleParticle> particleList,SimpleParticleSystem sps)
 {
     if (SimpleParticleSystem.MaxParticles > particleList.Count)
     {
         float maxVel = 3.6f;
         SimpleParticle p=new SimpleParticle();
         p.Init();
         p.Position = position;
         p.velocity = new Vector3((float)random.NextDouble()* maxVel, Math.Abs((float)random.NextDouble()) * 3.0f, (float)random.NextDouble() * maxVel);
         p.Texture=sps.Texture;
         p.Effect=sps.Effect;
         particleList.Add(p);
     }
 }