[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Line collision detection?



On Mon, Feb 20, 2012 at 3:58 PM, Sam Bull <sam.hacking@xxxxxxxx> wrote:
Just a quick idea off the top of my head. What if you just get a rect
covering from the bullets previous position to the bullets new position? 
What about the diagonal motion?

I'd recommend something similar, though.  Just test the line y=mx+b against all your hitboxes.  There's fast code on the internet for that.

Ian