예제 #1
0
        private void DetectShipToMeteorCollisions()
        {
            if (!_ship.IsActive)
            {
                return;
            }

            for (int meteorIndex = 0; meteorIndex < _meteors.Count; meteorIndex++)
            {
                if (_meteors[meteorIndex].CollidesWithShip(_ship))
                {
                    _meteors[meteorIndex].IsActive = false;
                    GameManager.RaiseMeteorHit(_meteors[meteorIndex]);
                    BlowUpShip();
                }
            }
        }
        private void DetectShipToMeteorCollisions()
        {
            if (!_ship.IsActive)
            {
                return;
            }

            for (int meteorIndex = 0; meteorIndex < _meteors.Count; meteorIndex++)
            {
                if (_meteors[meteorIndex].CollidesWithShip(_ship))
                {
                    _meteors[meteorIndex].IsActive = false;

                    GameManager.RaiseMeteorHit(_meteors[meteorIndex]);
                    BlowUpShip();
                    System.IO.Stream         str = Properties.Resources.mySoundFile;
                    System.Media.SoundPlayer snd = new System.Media.SoundPlayer("bang_6.wav");
                    snd.Play();
                }
            }
        }