Lunar Lander Collison Routines

Hi all

Once again, I need the groups advice. I have already recieved some info
for a pixel based collision routine, involving heightmaps, but I don’t
understand what those are.

Could someone give me a “for dummies” explanation of how I would check
to see if my ship has collided with a bitmap of a lunar mountain range,
as in the original. The background is a bitmap and loaded as a surface.
As I mentioned, I have tried a bounding box collision and it really
doesn’t work well for the mountiain collisions.

Thanks in advance,
Don

This is pretty off-topic for the SDL list, actually. You might want to find
a general game programming mailing list for your question.

However, I recently did a Lunar Lander style game for cellphones (which sadly
got pulled off the market after only a few months by the wireless carrier,
even though it was a pretty good implementation! >:^P … maybe if it were
’Spider-Man Lander’ or ‘The Hulk On The Moon,’ they’d have kept it ;^) )

Anyway, my game was completely vector-based (like the original arcade game
by Atari), and I actually used line intersection tests to see if any part
of the ship is touching or passing through any part of the moon.

To speed this up, I first did bounding box: “Is it POSSIBLE that the lines
intersect?” If not, don’t bother doing the computational-heavy intersection
test.

You’ll want to keep your bounding box code where it is, but then once you’ve
determined that your ship sprite MIGHT be touching some particular background
object, THEN do some pixel-perfect detection.

This has actually been brought up around here before, and someone or other
has a demo they seem to always refer people to. If only I could remember.
(In the meantime, check the list archives ;^) )

Good luck!

-bill!
bill at newbreedsoftware.com New Breed Software
http://www.newbreedsoftware.com/ Tux Paint 0.9.14 is out!On Sun, Nov 07, 2004 at 03:26:26PM -0400, Donald wrote:

Could someone give me a “for dummies” explanation of how I would check
to see if my ship has collided with a bitmap of a lunar mountain range,
as in the original. The background is a bitmap and loaded as a surface.
As I mentioned, I have tried a bounding box collision and it really
doesn’t work well for the mountiain collisions.