/// <summary> /// Hurts this entity for the specified amount. /// </summary> /// <param name="amount">Number of damage points.</param> public void Hurt(int amount) { Health -= amount; if (Health <= 0) { Engine2D.DespawnEntity(Entity); } }
/// <summary> /// Stops highlighting the entity. /// </summary> public void Deselect() { Entity.OnPositionChanged -= PositionChanged; Engine2D.DespawnEntity(Effect); Effect = null; }