예제 #1
0
 public bool canibal(snake s)
 {
     for (int i = 0; i < s.body.Count; i++)
     {
         if (this.body[0].IntersectsWith(s.body[i]))
         {
             return(true);
         }
     }
     return(false);
 }
예제 #2
0
 public void die(snake s, ref bool ya)
 {
     for (int i = 0; i < s.body.Count; i++)
     {
         for (int j = 0; j < this.body.Count; j++)
         {
             if (this.body[j].IntersectsWith(s.body[i]))
             {
                 ya = true;
             }
         }
     }
 }
예제 #3
0
 public bool collideWithPlayer(snake p)
 {
     for (int i = 0; i < this.body.Count; i++)
     {
         for (int j = 0; j < p.body.Count; j++)
         {
             if (this.body[i].IntersectsWith(p.body[j]))
             {
                 return(true);
             }
         }
     }
     return(false);
 }