Example #1
0
 protected virtual void OnCoinc(CoincEventArgs e)
 {
     if (Coinc != null)
     {
         Coinc(this, e);
     }
 }
 void WorldCoinc(object sender, CoincEventArgs e) {
     if (e.Missile1 == Pruneau || e.Missile2 == Pruneau) {
         // Explode rock or meteor
         var rock = e.Missile1 == Pruneau ? e.Missile2 : e.Missile1;
         // Does this rock belong to a meteor?
         foreach (var meteor in Meteors) {
             if (meteor.Has(rock)) {
                 if (meteor.IsExploded) {
                     rock.IsVisible = false;
                 }
                 else {
                     meteor.Explode();
                     MakeExplosionSound();
                 }
                 Pruneau.IsVisible = false;
                 return;
             }
         }
     }
     if (e.Missile1 == Ship || e.Missile2 == Ship) {
         // You lose
     }
 }
 protected virtual void OnCoinc(CoincEventArgs e) {
     if (Coinc != null) {
         Coinc(this, e);
     }
 }