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

Re: [pygame] Background and collision detection in Lunar Lander game



You can look in the pygame ftp, there is a file named petephysics.tar.gz. It has an example of this kind of collision detection that you need. I don't know who did it but you won't need to copy the code because it is based in a gamasutra article, from there you could do your own implementation. I would like to see this code in the pcr if the author give us permission.

Em Sun, 14 Jul 2002 17:28:35 -0500
"Michael Bauers" <me@michaelbauers.com> escreveu:

> I have written a simple Lunar lander type game in pygame.
> 
> I now want to add a lunar surface with a designated landing area.
> 
> I can do the surface as a BMP of course.  But I want an easy way to handle collision detection.
> 
> Is there any cookbook method for this?
> 
> I thought about writing a program to convert the BMP into a set of rectangles that could be used for collision detection.  I coul then put those rectangles in a file, load the file at run time, and build a list.
> 
> Two problems with that:  I do not know the format of a BMP.  And I think I would get a LARGE number of rectangles on a 30x300 BMP file.
> 
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org