예제 #1
0
 /// <summary>
 /// Detects a collision between two BoundingRectangles
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b"></param>
 /// <returns>true for collision, false otherwise</returns>
 public static bool Collides(BoundingRectangle a, BoundingRectangle b)
 {
     return(!(a.Right < b.Left || a.Left > b.Right ||
              a.Top > b.Bottom || a.Bottom < b.Top));
 }
예제 #2
0
 public static bool Collides(BoundingRectangle r, BoundingCircle c) => Collides(c, r);
예제 #3
0
 public bool CollidesWith(BoundingRectangle other)
 {
     return(CollisionHelper.Collides(this, other));
 }