Sometimes the Tutorials give me trouble as well. Here is a code for making a matrix: (Basically, the "floor" of your game. Thanx to Cypher and UnderLord for fixing my errors
)
rem <<<<==================================>>>>
set display mode 1024,768,16
rem Load castle
make object box 1,500,300,100
position object 1,5000,20,6000
rem show
show object 1
rem This command will load a midi music file into number one
load music "Field.mid",1
rem Play the music that was loaded into number one
play music 1
Sync On
Sync Rate 24
Hide mouse
Backdrop on
Set camera range 1,10000
remstart
Fog on
Fog distance 300
Fog color RGB(128,128,499)
Color Backdrop RGB(128,128,499)
remend
Rem make matrix
Make matrix 1,10000,10000,20,20
Rem texture matrix
Load image "creep02.bmp",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1
rem Randomize the matrix
randomize matrix 1,125
X#=5000
Z#=5000
Rem Main loop
Do
OldCamAngleY# = CameraAngleY#
OldCamAngleX# = CameraAngleX#
CameraAngleY# = WrapValue(CameraAngleY#+MousemoveX()*0.2)
CameraAngleX# = WrapValue(CameraAngleX#+MousemoveY()*0.2)
Rem Control input for camera
If Upkey()=1
XTest# = Newxvalue(X#,CameraAngleY#,10)
ZTest# = Newzvalue(Z#,CameraAngleY#,10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Downkey()=1
XTest# = Newxvalue(X#,Wrapvalue(CameraAngleY#-180),10)
ZTest# = Newzvalue(Z#,Wrapvalue(CameraAngleY#-180),10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Leftkey()=1
XTest# = Newxvalue(X#,Wrapvalue(CameraAngleY#-90),10)
ZTest# = Newzvalue(Z#,Wrapvalue(CameraAngleY#-90),10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
If Rightkey()=1
XTest# = Newxvalue(X#,Wrapvalue(CameraAngleY#+90),10)
ZTest# = Newzvalue(Z#,Wrapvalue(CameraAngleY#+90),10)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
X#=XTest#
Z#=ZTest#
Endif
Endif
Yrotate camera CurveAngle(CameraAngleY#,OldCamAngleY#,24)
Xrotate camera CurveAngle(CameraAngleX#,OldCamAngleX#,24)
Y# = Get ground height(1,X#,Z#)
Position Camera X#,Y#+50,Z#
set cursor 20,20
print "X#",X#
set cursor 20,60
print "Z#",Z#
Rem Refresh Screen
Sync
Loop
There is no king who has not had a slave among his ancestors, and no slave who has not had a king among his
Ph33r the Ringwraiths