Section 1.3 - Controlling your character:
For this we will be using something called XCollision, together with Advanced Terrain's own system. When we create the AT world we will designate certain areas to have certain 3D models. When you approach that area you will use XCollision for that model. The thread for XCollision is here:
http://forum.thegamecreators.com/?m=forum_view&t=10315&b=6
We will also be using the AT version of the Get Ground Height() command. This, as shown in DBC tutorial #23, allows you to walk over an uneven terrain.
But first, we need to control the character.
The
control object using arrowkeys() will suffice.
Next, we need to check to make sure the gradient is not to steep. We will check the heightmap, and find the difference between the heights of the 2 points:
steepness=RGBR(POINT(newpoint))-RGBR(POINT(oldpoint))
We will need to use this expression on bitmap 1, which we will allocate to the heightmap image.
We then need to check that we are not walking into a substance like lava.
We will use bitmap 2 for a map of substances.
We have 16,777,216 different colours at our disposal. That is the maximum number of different terrain types.
By using a POINT() command on bitmap 2 we can get the terrain type
I can't be bothered to invent a signature