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

Re: [pygame] Game idea revised



Charles Joseph Christie II wrote:

Bounding rect? you mean like something that surrounds an object and
tells if the two bounding rects touched? That's what I thought he meant
by pixel perfect detection. Oops. ^_^;;

No, "pixel perfect" usually means taking the actual shape of the object into account, i.e. comparing their bitmaps. This is obviously a lot more expensive than just comparing the bounding rects.

Rest assured that Python has no trouble doing integer
arithmetic accurately, and will tell you for certain
whether the bounding rects intersect or not. :-)

(If you were using floats for your rect coordinates,
you might have some accuracy limitations, but that's
a general feature of float arithmetic, and nothing to
do with Python.)

--
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiem!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing@xxxxxxxxxxxxxxxx	   +--------------------------------------+