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

[pygame] Questions about rect.collidelistall



I am trying to convert a program from tile-based collision detection to pixel-based collision detection, and I see this function:

pygame.rect.collidelistall()

Where does the list of rectangles come from?  Do I have to create it myself?  Does pygame keep a list entry for every rectangle I create?

And on a general level, if I have a world with 20 NPC's running around, what's the easiest/fastest way to check for collisions?  Is there a way do do it in fewer than N*N steps per frame? 

Thank you for being kind in the presence of my newbie-ness,
Chris McCormick


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org