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 void activate() { hero.setColor(box.Color); box.Visible = false; }