Sync On
Sync Rate 30
Rem make matrix
Make matrix 1,10000,10000,20,20
Rem texture matrix
Load image "C:\Documents and Settings\Administrator\Desktop\Modernage\textures\grass.bmp",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1
rem Make Gun
Make object cylinder 1,2
XRotate Object 1,90
Fix object pivot 1
Scale object 1,100,100,500
position object 1,0,-7,15
Lock object on 1
Rem Make bullet
Make Object Sphere 2,2
Hide Object 2
if Mouseclick()=1 and BulletLife=0
Position object 2,X#,Y#+43,Z#
Set object to camera orientation 2
BulletLife =25
Show object 2
Endif
If BulletLife > 0
Dec BulletLife
Move object 2,20
If BulletLife = 0 then Hide object 2
Endif
Rem Main loop
Do
set cursor 0,0
print X#
print Y#
print Z#
Rem Store Object angle
CameraAngleY# = Camera angle Y()
Rem Control input for camera
If Upkey()=1
XTest# = Newxvalue(X#,CameraAngleY#,20)
ZTest# = Newzvalue(Z#,CameraAngleY#,20)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
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 X#,Y#+35,Z#
Rem Refresh Screen
Sync
Loop