Hi,

If you have a 2-D grayscale heightmap where black is lowest area and white is the highest. Then there's a giant ball which is on halfway one of those "hills" there. So, the ball should get moving to the downhill straight to the black area there but where does ball "know" which direction to move? Somehow it has to be calculated from the pixels surrounding the ball but how? Which kind of "range" checking you would do in situation like this? And what if the ball is moving (by some other force than gravity) and the downhill gets under the ball to the right side for example. How you would calculate how it affects to the current speed and direction of the ball? Of course ball should change its direction littlebit to the right and speed may increase a little, but how much? How to calculate that? Color of the background pixels defines that I know, but......