Looking through the documentation and various tutorial sites, I still cannot understand how you are modifying the sprite.collide method with anything other than detecting collisions of rectangular borders.
I have a program that should detect a collision between the hook sprite and any of several fish stored in a sprite group called fishies
I can use:
for hit in pygame.sprite.spritecollide(self, self.fishies)
to return a list of colliding sprites using bounding rectangles, but I want to use circles or masks.
The documentation states that I can use:
pygame.sprite.spritecollide(self, self.fishies, False, collided = None)
where "collided" is a callback function. But I canβt understand what this means. Just write:
pygame.sprite.spritecollide(sprite, group, dokill, pygame.sprite.collide_circle())
causes an error.
Can someone help, or did I misunderstand how it should work?
source share