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

[pygame] Re: Hexagonal collision detection?



The entire screen is covered in varying shaped polygonal buttons.

And the arrangement of them will change periodically from 5-12
buttons.

The buttons geometrically interlace, but there is no regular pattern
to how they interlace.

It does worry me python wont do it fast enough, but I guess I'll find
out soon enough.


On Sep 15, 5:09 pm, Greg Ewing <greg.ew...@xxxxxxxxxxxxxxxx> wrote:
> 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