Esempio n. 1
0
        public void spawnParticleEffect(string effectName, Vector2 pos, Vector2 vel)
        {
            if (effectName == "portal_open")
            {
                cEmitter e = new cEmitter();
                e.Position = pos;
                e.EmitParticle = "portal_open_blue";
                e.EmitRate = new Vector2(10, 20);
                e.MaxAge = 200;
                e.EmitVelocityMin = vel;
                e.EmitVelocityMax = vel;
                _emitters.Add(e);
            }

            if (effectName == "ObjectDeath")
            {
                Random r = new Random();
                Vector2 v = Vector2.Zero;
                for (int i = 0; i < 100; i++)
                {
                    v.X = r.Next(-1000,1000)/1000f;
                    v.Y = r.Next(-1000,1000)/1000f;
                    spawnParticle("part_flare", pos, v);
                }
            }
        }
Esempio n. 2
0
 public void kill(cEmitter e)
 {
     _emitters.Remove(e);
     e.Dispose();
 }