O'Reilly logo

DarkBASIC Pro Game Programming, Second Edition by Joshua R. Smith, Jonathan S. Harbour

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using Bumpy Terrain

As with many features of the language, DB provides some very easy-to-use commands for working with terrain, and provides more complex commands for fine-tuning things. The easiest way to create bumpy terrain is to create a matrix, and then randomize it. A matrix is a complex surface constructed of quads. Each quad is called a tile by DB, and you can paint a texture onto each tile individually.

First, you can create a matrix using the make matrix command. This command will construct a simple flat matrix with the specified dimensions, and divide the matrix into the tiles specified using the x tiles and z tiles parameters.

make matrix matrix #, width, height, x tiles, z tiles

Next, you will want to load an image using the load ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required