Thanks again,I changed the code to the code below but it repeats the previous error at show sprite 1,line 201.
"rem loading paratrooper
rem select font
set text font "arial" : set text size 16
set text to bold : set text transparent
rem Loading prompt
center text screen width()/2,SCREEN HEIGHT()/2,"LOADING"
WAIT 3000
CLS
center text screen width()/2,screen height()/2,"PARATROOPER"
WAIT 3000
CLS
sync on
rem sync rate 60
Rem Load Media
Rem xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
load object "NewwaitingwithSA80,10.x",1
load object "NewwalkcyclewithSA80,4.x",2
load object "NewAIMwithSA80,1.x",3
load object "NewHOLDAIMwithSA80,1.x",4
rem load object "NewdownriflewithSA80.x",5
load sound "jungle.ogg",1
load image "Grasstexture1.jpg",1
rem sights xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
REm xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
rem Variables
Health = 100
rem load world or make matrix
make matrix 1, 2000, 2000, 25, 25
position matrix 1,-600, -20, -300
randomize matrix 1,rnd(10)
set matrix wireframe off 1
prepare matrix texture 1, 1, 1, 1
update matrix 1
rem xxxxxxxxxxxxxxxxxx
cy = object size y(1)/2
position camera 100, cy, -20
point camera 0, cy, 0
hide object 2
position object 2, x#, 0, z#
xrotate object 2,90
position object 1, x#, 0, z#
xrotate object 1,90
hide object 3
position object 3, x#, 0, z#
xrotate object 3,90
hide object 4
position object 4, x#, 0, z#
xrotate object 4,90
`hide object 5
`position object 5, x#, 0, z#
` xrotate object 5,90
rem play background music
loop sound 1
REM START LOOP
DO
rem xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
rem incandDec health
box 430, 10, Health*2+430, 20, rgb(255,0,0), rgb(255,0,0), rgb(0,255,0), rgb(0,255,0)
if inkey$() = "a"
dec Health
if Health < 0 then Health = 0
endif
if inkey$() = "q"
inc Health
if Health > 100 then Health = 100
endif
rem xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Rem control Player1
IF UPKEY() = 0
HIDE OBJECT 2
SHOW OBJECT 1
set object speed 1,7
LOOP object 1,23,265
position object 1, x#, 0, z#
ENDIF
if upkey() = 1
hide object 1
stop object 1
set object frame 1,0
rem xxxxxxxxxxxxxxxx
rem stop loop object 1 and reset animation
rem xxxxxxxxxxxxxxxx
rem move player forward
x# = newxvalue( x#, object angle y(2), -0.03 )
z# = newzvalue( z#, object angle y(2), -0.03 )
rem show animation 2xxxxxxxxxxxxxxxxxxxxxxx
show object 2
set object speed 2,7
LOOP object 2,1,22
position object 2, x#, 0, z#
ENDIF
Rem xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Rem AIMING
`if spacekey() = 0
`endif
if spacekey() = 1
hide object 1
stop object 1
set object frame 1,0
hide object 2
stop object 2
set object frame 2,0
set object speed 3,5
show object 3
loop object 3,24,36
position object 3, x#, 0, z#
rem swap to holding aim
stop object 3
hide object 3
set object frame 3,24
show object 4
loop object 4,36,56
position object 4,x#, 0, z#
rem xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
gosub make_cross_hairs
rem xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
endif
if spacekey() = 0
stop object 3
set object frame 3,0
hide object 3
stop object 4
set object frame 4,23
hide object 4
endif
rem hide object 3
rem loop object 4,25,43
Rem Left and Right
If Leftkey()=1 then aY# = Wrapvalue(aY#-1)
If Rightkey()=1 then aY# = Wrapvalue(aY#+1)
gosub updateobject
rem rotate the sphere
Yrotate object 1,aY#
yrotate object 2,ay#
yrotate object 3,ay#
yrotate object 4,ay#
sync
LOOP
end
movekeys:
vx#=0 : vz#=0
if keystate(17) then inc vx#,Speed#*sin(object angle y(1)) : inc vz#,Speed#*cos(object angle y(1))
if keystate(31) then dec vx#,Speed#*sin(object angle y(1)) : dec vz#,Speed#*cos(object angle y(1))
if keystate(30) then inc vx#,Speed#*sin(object angle y(1)-90) : inc vz#,Speed#*cos(object angle y(1)-90)
if keystate(32) then dec vx#,Speed#*sin(object angle y(1)-90) : dec vz#,Speed#*cos(object angle y(1)-90)
return
updateobject:
rem set the object to the mouse x value
xrotate object 1,wrapvalue(object angle x(1)+mousemovey()/8.0)
rem set the object to the mouse y value
yrotate object 1,wrapvalue(object angle y(1)+mousemovex()/8.0)
rem move object 1 to the new value give by pressing keys
position object 1,object position x(1)+vx#,5,object position z(1)+vz#
rem keep the camera behind object
position camera 0,object position x(1),object position y(1),object position z(1)
rotate camera 0,object angle x(1),object angle y(1),object angle z(1)
rem show the cross hairs
show sprite 1
return
make_cross_hairs:
if done=1 then return
create bitmap 1,33,33
lock pixels
ink 0,0
box 0,0,33,33
ink rgb(255,255,255),0
line 15,0,15,32
line 16,0,16,32
line 0,15,32,15
line 0,16,32,16
unlock pixels
get image 1,0,0,33,33
delete bitmap 1
sprite 10000,screen width()/2,screen height()/2,1 :`high number so as not to clash with objects/sprites you have
offset sprite 10000,15,15
hide sprite 10000
rem hide object to control camera
make object sphere 10000,10 :`high object number
hide object 10000 :` hide above object
Speed#=1 :` set the move speed of camera
done=1
return"
EDIT-with the updated code it stops again and says sprite does not exist at line 201.