XNA Rockstar

I'm making a tile-based game, and some of the tiles are part walkable, part not-walkable. (like half mountain, half dirt). I need a way to determine which part of the tile can be walked on and which part can't. I can't do it based on pixel color, so I wanted to know if anyone could help me out with some bright ideas.

I remember hearing something about an alpha channel mask you can put over your tiles, or recreate the tileset in black and white to designate walkable/not walkable. Is that the best (or only) way to pull this off If so, that would double the size of my tileset file



Re: XNA Game Studio Express collision detection - alpha channel mask?

George Clingerman

I would recommend looking at the XNA Resources Color Key map tutorial.Using a method like that isn't the only way I'm sure, but it would be fairly convenient and easy.







Re: XNA Game Studio Express collision detection - alpha channel mask?

Jim Perry

You could also pre-calculate the regions of the various tiles for their walkability, load that it at runtime and just compare the current position on the current tile to the data.




Re: XNA Game Studio Express collision detection - alpha channel mask?

XNA Rockstar

Thanks guys, I'll give it a shot a little later.

And George...what are you, the XNA spokesperson now Hehe, congrats on the interview





Re: XNA Game Studio Express collision detection - alpha channel mask?

George Clingerman

 XNA Rockstar wrote:

And George...what are you, the XNA spokesperson now Hehe, congrats on the interview



Oh...you saw that...





Re: XNA Game Studio Express collision detection - alpha channel mask?

XNA Rockstar

George Clingerman wrote:
XNA Rockstar wrote:

And George...what are you, the XNA spokesperson now Hehe, congrats on the interview



Oh...you saw that...

I think the whole XNA community saw it! You'll just have to get used to it now George...you're famous





Re: XNA Game Studio Express collision detection - alpha channel mask?

Jim Perry

Makes me even more jealous that I wasn't able to attend the launch. That could have been me!