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

Re: [pygame] Re: Hexagonal collision detection?



Hi,

I actually don't remember where the function came from...it would have been several years ago now.  I presented it simply, as I though it would be useful.  At the time I wrote the original code, I had no idea how it worked, and now . . . I still don't :P

I can tell you it basically tests the point against every line segment on the polygon.  Naturally, if it falls on the "inside side" of every line, then the point is in the polygon.  Googling "point polygon collision" brings up this method.  Still not sure how that the code actually does that though.

Ian