How can I test if a point lies between two parallel lines?

Posted by Harold on Game Development See other posts from Game Development or by Harold
Published on 2012-01-05T13:34:15Z Indexed on 2012/11/09 5:28 UTC
Read the original article Hit count: 298

In the game I'm designing there is a blast that shoots out from an origin point towards the direction of the mouse. The width of this blast is always going to be the same.

Along the bottom of the screen (what's currently) squares move about which should be effected by the blast that the player controls.

Currently I am trying to work out a way to discover if the corners of these squares are within the blast's two bounding lines. I thought the best way to do this would be to rotate the corners of the square around an origin point as if the blast were completely horizontal and see if the Y values of the corners were less than or equal to the width of the blast which would mean that they lie within the effected region, but I can't work out

© Game Development or respective owner

Related posts about collision-detection

Related posts about linear-algebra