Circle to Circle Collisions?

MikeHart

Administrator
Joined
Jun 19, 2017
Location
Germany
Look into fantomCX, there is a bunch of collision methods in one module. Sorry not at my comp. Let me know if you find it.
 

MikeHart

Administrator
Joined
Jun 19, 2017
Location
Germany
Did you found it? Here is one that just relies on the parameters:

Cerberus X:
'-----------------------------------------------------------------------------
Function Coll_Circle2Circle:Bool(x1:Float, y1:Float, radius1:float, x2:Float, y2:Float, radius2:float)
    Local xf:Float
    Local yf:Float
    Local rf:Float
   
    xf = x1 - x2
    xf *= xf
    yf = y1 - y2
    yf *= yf
    rf = radius1 + radius2
    rf *= rf
    If (xf+yf) < rf Then Return True
    Return False
End
 
Top Bottom