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

Re: [pygame] 2D collision decection & refraction function



I was just wondering if there is a collision decection & refraction >function, for basic 2D physics, if not I am going to make one.

The very basic, of course, is Sprite:
http://www.pygame.org/docs/ref/pygame_sprite.html

which may or may not do all that you need in the way of detecting
collisions. Pete has written a very nice tutorial intro to sprites:
http://www.pygame.org/docs/tut/SpriteIntro.html

If you need more precise collision detection, there is also the
"pixel-perfect" version (Sprite Collision and Mechanics Libary):
http://www.ifm.liu.se/~ulfek/projects/SCAM-current/doc/SCAM.html

I doubt anyone has written any very generic pygame code for
figuring out what happens to objects after you know they have
collided. There are just too many variables. Are your objects
rigid (ceramic), plastic (metal), sticky (magnetic), massive
(planets) ....

Check the Pygame Code Repository (PCR):
http://www.pygame.org/pcr/repository.php

and the project pages:
http://www.pygame.org/projects/
http://www.pygame.org/gamelets/

before you go to far down the "invent your own" path.


_________________________________________________________________
MSN 8 with e-mail virus protection service: 3 months FREE*. http://join.msn.com/?page=features/virus&xAPID=42&PS=47575&PI=7324&DI=7474&SU= http://www.hotmail.msn.com/cgi-bin/getmsg&HL=1216hotmailtaglines_eliminateviruses_3mf

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