Archived

This topic is now archived and is closed to further replies.

DevLiquidKnight

How do you do Collison detection in a cricle rather then rectangle

Recommended Posts

Circle collision is much easier than rectangle collision. The test for this looks like this:

If SQRT((Circle1.X, Circle1.Y) ^ 2 + (Circle2.X, Circle2.Y)^ 2) <= Circle1.Radius + Circle2.Radius Then
''Collision Detected
Else
''No Collision
End If

That''s how simple it is. I basically test the distance between both center points of the circles, Then it checks if that distance is less then the combined radius of the two circles. If the distance is les then there has been a collision.

That''s it

Horny Farmer (Jolly Rancher)

Share this post


Link to post
Share on other sites