Esempio n. 1
0
 //Returns true if a and b are touching (edges must overlap)
 public static bool CheckIntersect(SimpleRect a, SimpleRect b)
 {
     return(!(b.Left() > a.Right() || b.Right() < a.Left() || b.Top() < a.Bottom() || b.Bottom() > a.Top()));
 }
Esempio n. 2
0
 //Returns true if a and b are touching (edges inclusive)
 public static bool CheckCollision(SimpleRect a, SimpleRect b)
 {
     return(!(b.Left() >= a.Right() || b.Right() <= a.Left() || b.Top() <= a.Bottom() || b.Bottom() >= a.Top()));
 }