Miners4k Map

Okay I was looking into the game Miners4k what Notch created for a contest,
I would like to know how he made his map with collision as I have only done tile map rendering with collision,
I have looked around but I couldn’t find a word to describe his map. Could anyone lead me in the right direction?

That game, like Worms, is probably using a bitmap as a collision mask. You’ll probably need to write your own collision routines for this. If you come in to contact with a pixel that is solid, stop movement. It’s essentially no different from a tile based system, you just have really small tiles. One thing you have to be able to do is calculate a slop vector based on your movement across pixels so you know if you can climb a slope or not.

You could also go the destructible polygon terrain route and do something like starting with a big rectangle, and each time you want to break a part, recompose the shape with more polygons. I’m not really sure of the implications of this, but it’s likely much harder to do than the previous.

ah okay i thought it would be something like that, so for collision I would do something like this?
btw this is pseudo code not java as i havent even attempted doing it yet

if(pixel[player.x][player.y] == Color.blue){
player.velocity = 0 // I know this is not correct but you get the point right?
}

You don’t need to check for colours. Have two images, one is your presentation image where all the fancy graphics are, the second is your collision mask, where every pixel just needs to be 1 bit, on or off. You can even then use this mask to say what parts of the presentation image are drawn.

That code code won’t quite work, as you’re player will be bigger than a pixel, and you don’t want to be on the pixel in the first place, you’ll have to do a bounds test, but that’s essentially it.