How to detect 2D line on line collision?

Posted by Vish on Game Development See other posts from Game Development or by Vish
Published on 2012-03-22T08:42:09Z Indexed on 2012/03/22 17:43 UTC
Read the original article Hit count: 599

I'm a flash actionscript game developer who is a bit backward with mathematics, though I find physics both interesting and cool.

For reference this is a similar game to the one I'm making: Untangled flash game

I have made an untangled game almost to full completion of logic. But, when two lines intersect, I need those intersected or 'tangled' lines to show a different color; red.

It would be really kind of you people if you could suggest an algorithm with/without math for detecting line segment collisions. I'm basically a person who likes to think 'visually' than 'arithmetically' :)

P.S I'm trying to make a function as

private function isIntersecting(A:Point, B:Point, C:Point, D:Point):Boolean

Thanks in advance.

© Game Development or respective owner

Related posts about math

Related posts about actionscript-3