Posted: 17th May 2003 00:14
Well basically it is like this:
Make matrix 1,10000,10000,20,20
the make matrix command will make your matrix tiled from 0 till 19(=20 tiles) in the 2 directions of the matrix grid.
Load image "grass09.bmp",1
Prepare matrix texture 1,1,2,2 (matrix,image,horizontal tiles,v.tiles)
this will load image 1, and tile it 2x2=4 tiles for matrix 1 like this:
12
34
the rest of your code selects randomly 1 of the image tiles (1 to 4) and puts it in one of the matrix tiles (0-19,0-19)
each matrix tile is defined by 2 numbers, from 0,0 to 19,19 in this case, like this:
0,0 ; 1,0 ; 2,0 ....19,0
0,1 ; 1,1 ; 2,1 ....19,1
.
.
.
0,19 ; 1,19 ; 2,19 ....19,19