Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / edge to edge line collision detection?

Author
Message
ScottieBro
16
Years of Service
User Offline
Joined: 14th Dec 2009
Location:
Posted: 10th Oct 2010 01:31
say i have a box

tlx = x - scale
tly = y + scale

trx = x + scale
try = y - scale

brx = x + scale
bry = y + scale

blx = x - scale
bly = y + scale

and i wanna do collision detection of the four edges
hitting the other four edges

like boxtop1 = boxbottom2
boxbotttom1 = boxtop2
boxright1 = boxleft2
boxleft1 = boxright2

how can this be done????

Any help would be real nice because the code I worte is not working right.

hugh!

Jinkcy Cat
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 10th Oct 2010 21:58
Is there a reason you can't use some existing collision code/dll's out there? Collision is completely sorted there's no real need to re-write it...

I'd suggest taking a look at "Sparky's collision" dll as it is very accurate and fast but there are a few options to choose from here:
http://forum.thegamecreators.com/?m=forum_view&t=95770&b=7

(just type "massive collision" in the search bar at the bottom if you're ever looking for it again!)

Login to post a reply

Server time is: 2026-07-22 03:51:15
Your offset time is: 2026-07-22 03:51:15