Пример #1
0
 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;
     }
 }
Пример #2
0
        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;
            }
        }