Hmmm i'm still having problems...I will put the code in and if you dont mind, could you place in the position listener and rotate listener so i can see what i am doing wrong.
Sync on
Hide mouse
Sync rate 0
Backdrop on
Set camera range 1,5000
Fog on
Fog distance 4000
Fog color RGB(128,128,128)
Color backdrop RGB(128,128,128)
Make matrix 1,10000,10000,20,20
Load image "C:\Darkbasic\grass.jpg",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1
Randomize matrix 1,125
x#=5000
Y#=5000
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
Make Object Sphere 2,2
Hide Object 2
Load sound "C:\Darkbasic\crickets.wav",1
Loop sound 1
Load 3Dsound "C:\Darkbasic\gunshot1.wav",2
Load Image "C:\Darkbasic\matrix.jpg",2
For x = 0 to 10
Make object plain x+10,5,5
Texture object x+10,2
Set object x+10,1,0,0
Ghost object on x+10
Next x
Rem intialize particle counter
Pn=10
Do
OldcamangleY# = cameraangleY#
OldcamangleX# = cameraangleX#
CameraangleY# = wrapvalue(cameraangleY#+mousemovex()*0.2)
CameraangleX# = wrapvalue(cameraangleX#+mousemoveY()*0.2)
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
if Mouseclick()=1 and BulletLife=0
Position object 2,X#,Y#+43,Z#
Set object to camera orientation 2
BulletLife=25
show object 2
Loop sound 2
Endif
If BulletLife > 0
Dec BulletLife
Move object 2,10
bX#=Object position X(2)
bY#=Object position Y(2)
bZ#=Object position Z(2)
inc Pn
if Pn=20 then Pn=10
Scale object Pn,100,100,100
Position object Pn,bX#,bY#,bZ#
point object Pn,X#,Y#,Z#
Zrotate object Pn,rnd(180)
for x = 1 to 10
scale object int((Wrapvalue((Pn-9+x)*36))/36)+10,100+x*25,100+x*25,100+x*25
set cursor 10,10
print int((Wrapvalue((Pn+x)*36))/36)+10
next x
Position sound 2,bX#,bY#,bZ#
set cursor 10,10
if Sqrt((mX# - bX#)^2 + (mY#+25 - bY#)^2 + (mZ# - bZ#)^2) <20
print "hit hit hit hit hit hit hit hit"
BulletLife = 0
Endif
if BulletLife = 0
Hide object 2
stop sound 2
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#
Sync
Loop