Soundmap for Terrain

Back

 1

 

 

Example 1: Levelborder to hold the player

The level border, with the help of invisible blocks, can become a problem if the terrain much bendy. Protecting mountains against entering through the player is extensive and the many blocks isn't good for the clarity in WED.

I draw the border with on the colormap. The player may not jump over the border.  Drawing therefore with a fat brush, broadly as the player can jump. Using the tercolor.wdl for this example.

 

 

A small change only need now the player move script.

I think the following line is similar with yours.

 

move ( my, dist, nullvector );

 

The entity(player) becomes move with a relative speed according to its angle here. Thats written in DIST. The contents of dist are further defined before in the move script .

IN FRONT OF THIS MOVE LINE a couple of new lines come now. You must of course defining the variable at the beginning of your move.wdl. I write it her with to. The rgb_vec vector contain the actualy colormap color under the player feets. (already defines into the wdl's).

 

var border_free[3];  //this vector saved the player position, as long as he is outside the border.

var border[3] = 000,000,255; //this vector contain the border color, here RED. Attention color order BGR !!!

 

if (rgb_vec.blue != border.blue || rgb_vec.green != border.green || rgb_vec.red != border.red) {

    border_free.x = player.x;

    border_free.y = player.y;

    border_free.z = player.z;                                                                                                     }

if (rgb_vec.blue == border.blue && rgb_vec.green == border.green && rgb_vec.red == border.red) {

   vec_diff ( dist.x , border_free.x, player.x );                                                                                       }

 

Thats all. As long as the player doesn't enter the color border becomes the player position in border_free stored intermediately . Entered the player the border if changed the player movement direction in DIST. Of the present player position on the border to the last position outside the border(border_free). Becomes the player through this braked and thrown back. No matter whether if now in front or backward runs.

 

Example 2: Floramap of Level

You can set the trees and bushes bit by bit in your level, or with a random script. The problem at randomize put the trees is exclude the ways, rivers e.t.c. The colormap would be a help already here.

But here another example. Assumed you have two tree models. Now define a color for every tree and draw with this colors points in your colormap. On every point stand than a tree in your level.

 

 

There is a ready script also for this example. floramap.wdl DOWNLOAD

 

1