Пример #1
0
 /// <summary>
 /// Alternate call
 /// </summary>
 /// <param name="c"></param>
 /// <param name="r"></param>
 /// <returns></returns>
 public static bool Collides(BoundingCircle c, BoundingRectangle r) => Collides(r, c);
Пример #2
0
 /// <summary>
 /// Detects a collision between a rectangle and a point
 /// </summary>
 /// <param name="r">The rectangle</param>
 /// <param name="p">The point</param>
 /// <returns>true on collision, false otherwise</returns>
 public static bool Collides(BoundingRectangle r, BoundingPoint p)
 {
     return(p.X >= r.X && p.X <= r.X + r.Width && p.Y >= r.Y && p.Y <= r.Y + r.Height);
 }