VB Code:
Dim Distance as Single Distance = Sqr( (Obj1.x - Obj2.x)^2 + (Obj1.y - Obj2.y)^2 ) If Distance < Radius1 + Radius2 Then 'Collision! EndIf
Printable View
VB Code:
Dim Distance as Single Distance = Sqr( (Obj1.x - Obj2.x)^2 + (Obj1.y - Obj2.y)^2 ) If Distance < Radius1 + Radius2 Then 'Collision! EndIf
uh, are you displaying code for everyone to use...or asking a question?
im not really sure what you want, but ill tell you this, detecting colission of not rectangular objects is a b****
Actually, It looks like a post with no body =). Yhoko was kind enough to post some general code in response to the subject (helpful subjects are so.. helpful =).
Z.
Here is a little program i made demonstrating that collision detection, with others.
http://209.120.143.185/showthread.ph...hreadid=177612
Sorry about that, I was having some trouble with my computer, just got the internet back on line after it crashed before I could complete my post.:(
Yhoko, thanks a lot! That code works very very well!:)
Thanks