Page 1 of 1

Colliding with a drawn line

Posted: Mon Nov 30, 2009 12:31 am
by Lazy Waffle
Is it possible to check if something collides with a line drawn with the love.graphics.line() function? Here's the code I use to draw the line:

Code: Select all

function draw()
	love.graphics.line(x1,y1,x2,y2)
	love.graphics.circle(1,x1,y1,10)
	love.graphics.circle(1,x2,y2,10)
end
x1, x2, y1, and y2 can be moved by the arrow keys and WASD.

Help would be appreciated :ultraglee:

Re: Colliding with a drawn line

Posted: Tue Dec 01, 2009 2:34 am
by TechnoCat

Re: Colliding with a drawn line

Posted: Tue Dec 01, 2009 12:56 pm
by Lazy Waffle
My game doesn't use Box2D physics, would it still work? Or is there an alternative?

Re: Colliding with a drawn line

Posted: Tue Dec 01, 2009 4:29 pm
by TechnoCat