Does anyone know how to position your enemies where you want them? Whenever I try to change its position it just ends up at the end of the matrix. Otherwise it starts directly under you.
rem --------------------------------------------
rem Golden Gun
rem --------------------------------------------
Sync On
Sync Rate 30
Hide mouse
Backdrop on
Set camera range 1,50000
Fog on
Fog distance 4000
Fog color RGB(128,128,128)
Color Backdrop RGB(128,128,128)
Rem make matrix
Make matrix 1,10000,10000,20,20
Rem texture matrix
Load image "steel01.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 load textures
load image "spistol.bmp",2
rem create walls
load image "cottag02.bmp",300
t=300
For x = 1 to 9
For z = 1 to 9
Make object cube t,100
Scale object t,400,600,100
y = get ground height(1,x*1000,z*1000)
position object t,x*1000,y+275,z*1000
texture object t,300
scale object texture t,1,-6
inc t
next z
next t
rem make gun
load object "S&W4506.x",1
Scale object 1,3,3,3
Yrotate object 1,270
position object 1,5,-5,15
Lock object on 1
Rem Make bullet
Make Object Sphere 2,1
texture object 2,2
Hide Object 2
rem make enemies
load object "thugidle.x",3
Fix Object Pivot 3
Loop Object 3
mX# = 5000
mZ# = 5000
mY# = Get Ground Height(1,5000,5000)
X# = 5500
Y# = Get Ground Height(1,5500,5500)
Z# = 5500
MonsterScore=0
PlayerScore=0
Gosub PlaceMonster
set object speed 3,30
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 Mouseclick()=1 and BulletLife=0
Position object 2,X#+8,Y#+43,Z#
Set object to camera orientation 2
BulletLife =25
Show object 2
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 BulletLife > 0
Dec BulletLife
Move object 2,20
If BulletLife = 0 then Hide object 2
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#
Rem Refresh Screen
Sync
Loop
PlaceMonster:
mX#=X#
mY#=Y#
mZ#=Z#
mX#=rnd(10000)
mZ#=rnd(10000)
mY#= get ground height(1,mX#,mZ#)
mX#=X#
mY#=Y#
mZ#=Z#
Position object 3,mX#,mY#,mZ#
return
$$$Serpant$$$