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

Re: [pygame] shapes other than rects?



There's a library called SGE linked from the SDL libraries page. It has drawing functionality and some collision detection I'd very much like to see in pygame. Per-pixel collision detection between "pixel masks". So you could create pixel masks out b&w of images or out of image aplha channels (often a pixel mask would be just that, but not necessarily always) and the check for collisions between these.

I need this functionality in my game and I'm currently contemplating whether to implement it in Python (speed?), C, or try my hand at swiggin' SGE.

-
Martin
come.to/vague



----- Original Message ----- 
From: "Pete Shinners" <shredwheat@mediaone.net>
To: <pygame-users@seul.org>
Sent: Thursday, January 25, 2001 5:00 AM
Subject: 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