Basic Box and Line collision

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
BattleSrc
Prole
Posts: 2
Joined: Tue Jun 10, 2014 4:31 pm

Basic Box and Line collision

Post 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
Attachments
jam.love
(2.62 KiB) Downloaded 120 times
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Basic Box and Line collision

Post 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.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
BattleSrc
Prole
Posts: 2
Joined: Tue Jun 10, 2014 4:31 pm

Re: Basic Box and Line collision

Post by BattleSrc »

There's no restrictions so I'll take a look thanks :)
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests