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

Re: [pygame] Polygon Objects



David J. C. Beach wrote:
Is there any interest in having such functionality available in pygame?
There is interest in getting this in Python. Things can get a little tricky with shape classes because eventually a 'miraculous' design wants them all communicating with each other and replaceable by others.

I really don't think we need anything that amazing. A simple way to turn a Rect into a 4 sided polygon, and create a Rect from a polygon bounding area should be all that is needed. Then polygon functions can just deal with other polygons and not try to be overly flexible.

It would still be best to clean up the Poly functions from the Python code first. Got it anyplace people can peek? Collisions and Drawing are the only two main features I think of for polygons. Other features might be things like paths and booleans, but that starts to be more work. I think something simple and elegent would be a better starting place.