This is the code I began with
rem make matrix and divide it into a 10x10 grid
make matrix 1,1000,1000,10,10
rem load and configure texture
load bitmap "cotton02.bmp",1
get image 1,0,0,256,256
delete bitmap 1
rem fill matrix with first texture
prepare matrix texture 1,1,2,2
fill matrix 1,0,1
rem load and configure second texture
load bitmap "slime02.bmp",2
get image 2,0,0,256,256
delete bitmap 2
rem activate manul sync
sync on
rem start main loop
do
rem set text opaque and pritn camera postion
set text opaque
set cursor 0,0
print x#
print z#
rem Control camera with arrow keys
rem uses wrapvalue commnd to calcualte camera angle
if upkey()=1 then move camera 10.0
if downkey()=1 then move camera -10.0
if leftkey()=1 then angley#=wrapvalue(angley#-2.0)
if rightkey()=1 then angley#=wrapvalue(angley#+2.0)
rem Update camera
xrotate camera 0.0
yrotate camera angley#
zrotate camera 0.0
rem determine camera position
X# = Camera position X()
Z# = Camera position Z()
rem sync the screen
sync
rem end main loop
loop
I tried using if statements to determine where the camera is in terms of x and z coordinates and then tried to use that to change the tile. In my main loop I would put in
if x#<100 and z#<100
prepare matrix texture 1,2,1,1
set matrix tile 1,1,1,2
endif
Basically if the if statemnt above was true then I believed the player was in tile 1,1 so the computer needs to set the matrix texture of tile 1,1 to texture 2. At least thats what I think should happen. Unfortunately, when I used the above I would either get no result at all or the entire matrix would change texture.
What am I doing wrong?