The second option is certainly more efficient, but probably not efficient enough.
My idea was to have an image map for the background of a game, and then have an invisible duplicate map that was just black and white. a character can move around in the black areas, but not the white areas. So I would check to see if the character's sprite DestRect had hit any white pixels. If so, then the character wouldn't move.
Maybe there is a better way?
-Sterling
Basil,
I realize this might be very efficient on the CPU, but what a nightmare to setup.
If your map is 8Kx8K, that would be 1,000,000 squares to place.
-Sterling
Okay, 16x16 saves a lot, but that still over 250K Black and white blocks to place.
What Windows Utility do you have in mind?
-Sterling
Try to use Box2D - here is a lib for that, really cool 2D collision library
Another idea is to use BSP ( Binary Space Partition ) for world, really the best in speed/size especially for complex solid structures
frankly, BSP is very complex thing to understand and to implement, so i will recommend Box2D, especially because of lib ready and lot of docs/samples about this crossplatform lib around
Good luck ! Time to sleep in my country ) CU
there's no need for all those extra huge maps.
just create something that's 1x,2x or 3x player width (from the next animation frame) and put the player mask inthere (1's) and add the enemy (also 1's)
when it's in that playerx-player.width to player+player.width boundery box to the map.
then all you need is a quick scan to see if there is a value equal to 2 which means a hit/collide (1 player + 1 enemy = 2, 1 is something, 0 is nothing).
I looked briefly at Box2D. Seems to have some promise. Not what I'm looking for, unless I missed something. It seems to just be a physics engine.
-Sterling