[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] shapes other than rects?



> I'd like to be able to have shapes other than rectangles in my game,
> preferrably with the same functionality as rects (collision detection, etc).
> Does anyone have any advice for me for creating such things? I realize
> creating a base rect-like object would be quite processor intensive for
> lots of calculations... I'm open to ideas. Thanks.

hmm. after we get pygame 1.0 out and i've finished my first
game project, my goal was to go in and add some sort of drawing
libraries. i was thinking lines, ellipses, and triangles would
be enough to create just about anything.

interesting though, i had never thought about collision tests
for these primitives, it is a good idea though.

at this point there's no support for handling anything besides
rectangles. perhaps you can get away with just prerendering the
basics out as images and going with that.

if you really need to do other types of drawing, your two options
are to either do it in python code with the surfarray module, or
write a version in C. i know there's available code out there for
drawing basic shapes into SDL surfaces. it would not be too hard
to take that code and create a new python extension module with
a couple drawing functions.

well that is where we're at now for shapes and pygame. the fact is
SDL doesn't really support these types of things (except for a 
couple 3rd party libaries). so pygame will need to break out and
really start using some of its own algorithms. it will happen
eventually, but not until after 1.0


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org