And how do I find out what version of direct x I currently have?
How can I detect whether the bullets hit the player?
Thanks for all the help
sync on
sync rate 80
hide mouse
dim health#(6)
dim etlock#(6)
health#(1) = 140
load image "ground.bmp",1
load image "sky.bmp",2
create bitmap 3,50,50
create bitmap 4,50,50
make matrix 1,10000,10000,100,100
randomize matrix 1,50
prepare matrix texture 1,1,1,1
set matrix texture 1,1,1
fog on
fog distance 4000
fog color rgb(128,128,128)
backdrop on
color backdrop rgb(128,128,128)
make object cylinder 1,20
xrotate object 1,85
fix object pivot 1
scale object 1,50,375,50
position object 1,0,-15,50
color object 1,rgb(0,0,255)
lock object on 1
make object sphere 7,2
hide object 7
color object 7,rgb(255,0,0)
make object plain 8,10,10
position object 8,14.2,9.5,25
lock object on 8
ghost object on 8
for I = 2 to 6
make object cube I,100
position object I,500*I,0,500*I
texture object I,2
make object collision box I,-50,-50,-50,50,50,50,0
health#(I) = 100
etlock#(I) = 0
next I
for I = 9 to 13
make object sphere I,10
color object I,rgb(255,0,0)
position object I,100*(I-7),20,100*(I-7)
hide object I
next I
rem main loop
cay# = camera angle y()
cax# = camera angle x()
cx# = 5000
cz# = 5000
do
ocax# = cax#
ocay# = cay#
cax# = wrapvalue(cax# + mousemovey()*0.5)
cay# = wrapvalue(cay# + mousemovex()*0.5)
xrotate camera curveangle(cax#,ocax#,5)
yrotate camera curveangle(cay#,ocay#,5)
if upkey()= 1
xtest# = newxvalue(cX#,cay#,2)
ztest# = newzvalue(cz#,cay#,2)
if xtest# < 10000 and xtest# > 0 and ztest# < 10000 and ztest# > 0
cx# = xtest#
cz# = ztest#
endif
endif
if downkey()=1
xtest# = newxvalue(cx#,cay#,-2)
ztest# = newzvalue(cz#,cay#,-2)
if xtest# < 10000 and xtest# > 0 and ztest# < 10000 and ztest# > 0
cx# = xtest#
cz# = ztest#
endif
endif
if leftkey()= 1
xtest# = newxvalue(cX#,cay#-90,2)
ztest# = newzvalue(cz#,cay#-90,2)
if xtest# < 10000 and xtest# > 0 and ztest# < 10000 and ztest# > 0
cx# = xtest#
cz# = ztest#
endif
endif
if rightkey()=1
xtest# = newxvalue(cx#,cay#+90,2)
ztest# = newzvalue(cz#,cay#+90,2)
if xtest# < 10000 and xtest# > 0 and ztest# < 10000 and ztest# > 0
cx# = xtest#
cz# = ztest#
endif
endif
if mouseclick()= 1 and tlock# = 0
position object 7,cx#,cy#-10,cz#
set object to camera orientation 7
show object 7
tlock# = 40
endif
if tlock# > 0
dec tlock#
move object 7,20
endif
if tlock# = 0 then hide object 7
if object collision (7,0)
hit = object collision(7,0)
if hit < 7 and hit > 1
dec health#(hit),20
endif
hide object 7
position object 7,cx#,cy#-10,cz#
endif
cy# = get ground height(1,cx#,cz#)+50
position camera cx#,cy#,cz#
set current bitmap 3
cls rgb(255,255,255)
copy bitmap 3,4
set current bitmap 4
ink rgb(0,0,255), rgb(0,0,0)
prx# = cx#/200
prz# = 50-(cz#/200)
circle prx#,prz#,1
for I = 2 to 6
if object exist (I)
ex# = object position x(I)
ex# = ex# / 200
ez# = 50-(object position z(I))/200
endif
ink rgb(255,0,0),rgb(0,0,0)
circle ex#,ez#,1
next I
get image 3,0,0,50,50
set current bitmap 0
texture object 8,3
ink rgb(255,0,0),rgb(0,0,0)
for I = 2 to 6
if object exist(I)
cx# = camera position x()
cz# = camera position z()
mx# = object position x(I)
my# = object position y(I)
mz# = object position z(I)
amx# = object angle x(I)
amy# = object angle y(I)
amz# = object angle z(I)
mbx# = object position x(I + 7)
mby# = object position y(I + 7)
mbz# = object position z(I + 7)
nmx# = newxvalue(ex#,aex#,150)
nmz# = newzvalue(ez#,aez#,150)
dist# = sqrt((mx# - cx#)^2 + (mz# - cz#)^2)
if dist# < 410
position object I + 7,mx#,my# + 20,mz#
point object I + 7,cx#,cy#,cz#
etlock#(I) = 50
show object I + 7
endif
if health#(I) = 0 or health#(I) < 0 then delete object (I)
endif
if object exist(I)
point object I,cx#,cy#,cz#
if dist# > 400
print dist#
move object I,2
endif
endif
next I
for I = 2 to 6
if etlock#(I) > 0
move object (I + 7),20
dec etlock#(I)
endif
next I
if health#(1) = 0 then end
if health#(1) < 0 then end
sync
loop