示例#1
0
 private void ennemiesCollision()
 {
     foreach (Foe baddy in baddies)
     {
         if (Engine2D.testCollision(who, baddy.Bbox))
         {
             Exit();
         }
         if (baddy is Cyberman)
         {
             if (Engine2D.testSonicAttack(who.SonicBbox, baddy.Bbox))
             {
                 baddy.kill();
             }
             if (Engine2D.testCollision(baddy, this.tardis.shieldBbox))
             {
                 baddy.kill();
             }
         }
         else if (baddy is Dalek)
         {
             if (Engine2D.testLaserAttack(who.Bbox, (Dalek)baddy) && who.DoctorMouvement != Mouvement.GLISSADE)
             {
                 Exit();
                 who.State = Status.DEAD;
             }
         }
         else if (baddy is WeepingAngel)
         {
             if (Engine2D.testCollision(baddy, this.tardis.shieldBbox))
             {
                 baddy.State = Status.BLOCKED;
             }
         }
     }
 }