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

Re: [pygame] Collision detection revisited



I think that it's actually faster to check pixel for pixel if it's
done right.
The memory requirement is 4 bytes per 32 pixels + 4 bytes per line and
16 bytes for the data structure, so it's very little compared to the
image itself.
It can find a "hit location", and also the number of pixels that
overlapped.

The newest release, with PyGame support, is at
http://www.ifm.liu.se/~ulfek/projects/SCAM-current/doc/SCAM.html
with python documentation at 
http://www.ifm.liu.se/~ulfek/projects/SCAM-current/doc/python-api.txt

It requires a C compiler to install right now, and I haven't tested it
on windows,
but it should work.. 

Please mail your bug reports!

--Ulf, ulfek@ifm.liu.se
-------------------
> I'd be interested, too.. so put that link on the mailing list too.
> 
> I was originally thinking of checking for rect collisions then also
have
> multiple rects for each object to determine a basic "hit location".
But if
> your project can do it by pixel without too much more memory.. Cool.
;)
> 
> ----- Original Message -----
> From: "Ulf Ekström" <ulfek@ifm.liu.se>
> To: <pygame-users@seul.org>
> Sent: Sunday, March 24, 2002 9:41 AM
> Subject: Re: [pygame] Collision detection revisited
> 
> 
> > Thanks alot Pete! Now I'm off writing my game :)
> >
> > The code you wrote had some oddities, but I'll complete your work
> > and release a new version soon. I'll send you a link when it's
finshed
> > so you can put it on the project page if you like.
> >
> > --Ulf
> >
> >
> > -------------------
> >
> > > ulf, i'm sure you can take it from here and add whatever else
needs
> > > doing. i commented the areas that need any explanation. i've
also
> > added
> > > a pretty complete distutils setup and config scripts. it should
> > build
> > > and install on windows, unix, and darwin. it compiles the SCAM
code
> > in
> > > statically, so it is a complete standalone python extension
module.
> >
> > You have saved me many hours of work! Thanks again.
> >
> >
> > ____________________________________
> > pygame mailing list
> > pygame-users@seul.org
> > http://pygame.seul.org
> 
> ____________________________________
> pygame mailing list
> pygame-users@seul.org
> http://pygame.seul.org
> 
/*
 *Ulf Ekström
 */
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org