Are you creating the terrain using a heightmap? If so create another bitmap the same same size and simply paint a particular colour for where you can walk and other colour for where you can't. You can read that bitmap into an image and read pixels depending on where your character is?
You could use any number of key colours to indicate different terrain - water, sand, swamp, forest etc.
You could use any number of key colours to indicate different terrain - water, sand, swamp, forest etc.