Circle to Rectangle Collisions - HELP

BlitzMax Forums/BlitzMax Programming/Circle to Rectangle Collisions - HELP

I would say, if the Radius of the circle is within the bounding Rectangle it is colliding.

R=Radius
X,Y are the Center.

X1,Y1 and X2,Y2 and the two corners of the rect.

If (X+R)> X1 and (Y+R)> Y1 Then Collide
If (X-R)< X2 and (Y-R)< Y2 Then Collide