Here it is, I forgot how to make a snippet.
UnseenGhost
cls
set display mode 800,600,16
hide mouse
sync on
make matrix 1,2000,2000,30,30
rem texture matrix
load image "grassb.bmp",1
prepare matrix texture 1,1,2,2
rem main loop
do
rem store object angle
cameraAngleY# = camera angle Y()
rem control input for camera
if upkey()=1
xtest# = newxvalue(x#,camereAngleY#,10)
ztest# = newzvalue(z#,cameraAngleY#,10)
if xtest#>0 and xtest#<2000 and ztest#>0 and ztest#<2000
move camera 10
endif
endif
if leftkey()=1 then Yrotate camera wrapvalue(cameraAngleY#-5)
if rightkey()=1 then Yrotate camera wrapvalue(cameraAngleY#+5)
x# = camera position x()
z# = camera position z()
Y# = get ground height(1,x#,z#)
position camera 1000,y#+100,1000
rem refresh screen
sync
loop