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

Re: [pygame] pygame.sprite collision callback functions patch.



Cool.  Thanks John!

yeah, these functions are a fairly easy way to change collision behaviour.

sjbrown was interested in doing a sweeping collision module.  See the
email with subject: Collision Resolver module
http://thread.gmane.org/gmane.comp.python.pygame/12496
http://thread.gmane.org/gmane.comp.python.pygame/12444

Maybe you guys could work together on something?  He's got the start
of some code in one of the threads.


Would it be possible to make some unittests for the functions you've
made?  We're trying to make all new code have unittests.



On Tue, Apr 22, 2008 at 3:18 AM, John Krukoff <helot@xxxxxxxxxxx> wrote:
>
>
>
>
> 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
>
>