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

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



> I can do the surface as a BMP of course.  But I want an easy way to 
> handle collision detection.

Probably the easiest is there are only a few designated landing areas, is to
find their coordinates and create a data file (a pickled list of double-coordinates?).
Otherelse, you can probably use some kind of pixel collision detection.
   /\
  /  \
.****.

if your spacecraft is touching one pixel and all pixels horizontally
touches, then you have landed? (too simple, but may give you an idea
of the type of tests you could do).
I believe than turning the map into a triangle would miss the point.
If you start doing that, you'd better design you game in 3d and use
pyOpenGL in pygame.

cheers,
Guillaume

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