i have it so you click on a matrix tile, it changes the texture.
what im working on now is, it checks the tile above it, and if it is a certain texture, then it will change it to another texture...but it doesnt seem to work
function
`--------------------------------------------------
`Change Tile
`--------------------------------------------------
function tile(tilex, tilez, tile#, size)
set matrix tile 1, tilex, tilez, tile#
map(tilex, tiley) = tile#
text 1, 108, "Texture :" +str$(map(tilex,tiley))
`if current selection is grass
if tile# = 1 and tilez > 0
`check the tile Above the current tile, to see if it is dirt
if map(tilex, (tilez + size)) = grass(2)
set matrix tile 1, tilex, (tilez + size), grass(6)
map(tilex, tilez + size) = grass(6)
endif
endif
endfunction
call:
if mouseclick() = 1 and menu = 0
tile(Int(Object Position X(1)/tilewidth),Int(Object Position Z(1)/tiledepth), tile#, 1)
endif
tilex and tilez are the coordinants that the mouse pointer are over
tile# is the current texture selected
map is the array that stores what texture is on what tile
grass is just an int...i made it an array to make it global.