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

Re: [pygame] Pixel perfect collision detection sugestion



On 9/10/05, Pete Shinners <pete@xxxxxxxxxxxx> wrote:
> The problem the author found was that in the situation where he was
> colliding many-to-many objects, most of the time was spent in finding
> which sprites to even try the pixel tests. There are good algorithms for
> generating trees of "nearest neighbors" which may be of help here. 

Hey,

good point.  Higher level collision detection is definitely needed. 
For example, if you were using tiles you could only collide those
sprites that are within that tile.  You could also avoid collision
detection if none of the sprites in that tile moved.  So the collision
detection would be:

1. higher level collisions
2. rect level collisions
3. per pixel collisions


Or is there a generic higher level thing even if not using tiles we
can use that will be fast enough anyway?