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

Re: [pygame] Re: sprite.spritecollide



You could identify your sprites with a unique id, then take the list returned by pygame.sprite.spritecollide and check which of them is in there, which will be the one that collided.

On Fri, Aug 14, 2009 at 22:40, Maxwell Wise <maxdwise@xxxxxxxxx> wrote:
Ok, say I have 8 instances of a class called Tableau, which is derived
from the sprite class.
These 8 instances are in a sprite group.

I have another sprite, that is of a different calss.
if the single sprite is colliding with one of the Tableaus,
colliding_with comes out to be

[<Tableau sprite(in 1 groups)>]

which is pretty cool, but i still don't know which of the 8 instances
it is...