Archived

This topic is now archived and is closed to further replies.

Kagemusha

Not-so-simple 2D Collision

Recommended Posts

Kagemusha    122
Let''s say that you were making a Lunar Lander type game using Pouya''s signature as the background: How would you test for collision detection with the hills? A tilemap probably wouldn''t be accurate enough (unless the tiles were very small, and that would bring up tilemap generation issues), and testing per-pixel would be too slow... Any ideas?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
I would use lines and polygons and test the spaceship against those polygons or lines...

Share this post


Link to post
Share on other sites
Arion    133

Maybe you could use bitmask detection.
A bitmask with the lunar lander, and a bitmask with the tiles. The bitmask with the tiles would be colour specific. The colours that make up the mountains would turn the bitmask to TRUE. The sky and clouds would be FALSE for no collision detection. However, this would only make the sky clear of collision and you couldn''t land in the foreground.

Guy

Share this post


Link to post
Share on other sites