public Explosion(Hero h, Enemy e) { splash = new XNACS1Circle(e.getPosition().Center, splashRadius); timer = new Timer(duration); splash.Color = h.getColor(); splash.Visible = false; splash.RemoveFromAutoDrawSet(); emitter = new ExplosionEmitter(e.getPosition().Center, duration, 0.6f, h.getColor()); emitter.DrawHalo(20); emitter.AutoRemoveDeadParticles = true; }
// fire the weapon public virtual void fire() { XNACS1Circle bullet = new XNACS1Circle(hero.getPosition().Center, bulletSize); bullet.Color = hero.getColor(); bullets.Enqueue(bullet); }
public override void update() { // kill the hero at the death wall if (hero.getColor() != color && deathGate.Collided(hero.getPosition())) { hero.kill(); } // kill any enemies at the death wall foreach (Enemy e in enemies) { if (e.getColor() != color && deathGate.Collided(e.getPosition())) { e.kill(); } } // dye the hero if (contains(hero.getPosition())) { hero.setColor(color); } // dye any enemies foreach (Enemy e in enemies) { if (contains(e.getPosition())) { e.setColor(color); } } }
public Explosion(Hero h, Enemy e) { splash = new XNACS1Circle(e.getPosition().Center, splashRadius); timer = new Timer(duration); splash.Color = h.getColor(); splash.Visible = false; splash.RemoveFromAutoDrawSet(); emitter = new ExplosionEmitter(e.getPosition().Center, duration, 0.6f, h.getColor()); emitter.DrawHalo(20); emitter.AutoRemoveDeadParticles = true; }