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

Re: [pygame] Hexagonal collision detection?



rygoody wrote:

I was just gonna use a linear equation to define the diagonal sides of
the hexagon, then go through a for loop to test on each line if the
click was in or out of the hexagon. But this seems so very inefficient
to do in python.

How many of these buttons are there going to be?

If there are only a few, I think you'll find it's
plenty fast enough in Python.

If there are many of them, are they in some kind
of regular arrangement, or are they arbitrarily
placed?

--
Greg