Page 1 of 1

Basic Box and Line collision

Posted: Tue Jun 10, 2014 5:07 pm
by BattleSrc
Hi there,
I'm very new to Love and Lua but I've done some gamedev before in the past. I'm currently participating in a Game Jam and I'm having some issues. I've attached my .love file which has a player with basic movement and some basic world generation using love.graphics.line. I've had a look around the forums and wiki but I can't work out how to link it into this so that the Player collides with the lines.

Any help or a shove in the right direction would be much appreciated.

Also I know what I've done so far is probably horribly inefficient or there are better ways to do things but I'm just trying to do the Game Jam so quick and dirty is all I have time for :P

Thanks

Re: Basic Box and Line collision

Posted: Tue Jun 10, 2014 6:09 pm
by davisdude
Hi, welcome to the forums. :)
Line-Segment to circle collision detection is very difficult. If you're allowed to use external libs for the jam, then I have one that does collision for you.
If not, you can just look here for the code.

Re: Basic Box and Line collision

Posted: Tue Jun 10, 2014 6:26 pm
by BattleSrc
There's no restrictions so I'll take a look thanks :)