protected override void collect(Megaman megaman) { megaman.ZeroTransition(); megaman.Points += pointValue; if (megaman.MaxHealth - megaman.Health < 10) { megaman.Health = megaman.MaxHealth; } else { megaman.Health += 10; } }
public override void Collide(ICollidable otherObject) { if (otherObject is Megaman && active) { sound.Play(); megaman = otherObject as Megaman; megaman.ZeroTransition(); megaman.Points += 1000; if (megaman.MaxHealth - megaman.Health < 10) { megaman.Health = megaman.MaxHealth; } else { megaman.Health += 10; } active = false; } }