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

[pygame] pygame.sprite collision callback functions patch.



So, I recently downloaded pygame 1.8, and was surprised to see the collision callback functions make their way into the final release. I’d been under the impression that things were trending towards a much more complicated collision system, and thought these would get cut.

 

In any case, here’s a set of updates to the sprite.py collision functions that update them to match the modules coding style, include appropriate comments, and are about 20% faster. It also includes a collide_circle_ratio function for completeness, and perhaps most importantly, fixes a bug in colide_mask which kept it from working correctly.

 

By the way, I keep meaning to write a sweep and prune collision detection implementation that’ll plug into the standard sprite module, has anybody done that already?

---------

John Krukoff

helot@xxxxxxxxxxx

 

Attachment: sprite.patch
Description: Binary data