Many thx for your kind comments,if you check the code Id say less than 10% is from help from this forum,90% + is from tutorials etc,I thought the whole point of having a forum was to ask if you dont know,otherwise what is the point in having this forum.
[code[code]]"
REM by
REM
autocam off
hide mouse
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 sound "cockgun-01.wav",2
load sound "Thompson-BlackCow-8183.wav",3
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 xxxxxxxxxxxxxxxxxxxxx
rem test camera alignment
make object cube 100,50
position object 100,1000, 0, 500
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
` if mode=0
` fps view
` position camera & point it formards
` position camera 0,5,0
` point camera 50*cos(angle#),5,50*sin(angle#)
` endif
`if mode=1
` 3rd person view
` position camera and point it at the player
` position camera object position x(2)-(30*cos(angle#)),20,object position z(2)-(30*sin(angle#))
` point camera object position x(2),5,object position z(2)
` endif
` this is to toggle the mode
` if inkey$()=" " and keypress=0
` if mode=1
` mode=0
` mode$="First Person View"
` else
` mode=1
` mode$="3rd Person View"
` endif
`
` keypress=1
` endif
` if inkey$()="" and keypress=1
` so the player must release the mode key before u can change mode again
` keypress=0
` endif
` animate the scene
` angle#=angle#+0.125
` angle#=wrapvalue(angle#)
` this just turns the player to match the cam angle
` yrotate object 2,0-angle#
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#
`wait 1000
`sync on
`sync rate 60
`color backdrop rgb(0,0,0)
`hide mouse
`autocam off
`cx#=camera angle x(0):cy#=camera angle y(0)
` fps view
` position camera & point it formards
`position camera object position x()object position y()object position z()
` point camera 50*cos(angle#),5,50*sin(angle#)
` endif
position camera x#, 8, z#
xrotate camera 180
YROTATE CAMERA AY#
`point camera
`yrotate camera 90
`if yrotate object 4
`yrotate camera
`endif
`if yrotate object 1 then rotate cy
`endif
`do
rem clear the screen or you have lots of crosses
`cls
`get mouse x y
mx=mousex()
my=mousey()
rem draw line from x y
line mx-10 ,my ,mx+10 ,my
line mx ,my-10 ,mx ,my+10
rem update screen
`sync
`loop
IF MOUSECLICK()=1
play sound 3
endif
endif
if spacekey() = 0
rem reposition camera
`position camera 100, cy, -20
`point camera 0, cy, 0
stop object 3
set object frame 3,0
hide object 3
stop object 4
set object frame 4,23
hide object 4
position camera object position x(2)-(30*cos(angle#)),20,object position z(2)-(30*sin(angle#))
point camera object position x(2),5,object position z(2)
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)
rem rotate the player1
Yrotate object 1,aY#
yrotate object 2,ay#
yrotate object 3,ay#
yrotate object 4,ay#
` YROTATE CAMERA AY#
`yrotate object 2,0-angle#
` position camera and point it at the player
` position camera object position x(2)-(30*cos(angle#)),20,object position z(2)-(30*sin(angle#))
` point camera object position x(2),5,object position z(2)
sync
LOOP"
[/code]
]"
REM by
REM
autocam off
hide mouse
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 sound "cockgun-01.wav",2
load sound "Thompson-BlackCow-8183.wav",3
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 xxxxxxxxxxxxxxxxxxxxx
rem test camera alignment
make object cube 100,50
position object 100,1000, 0, 500
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
` if mode=0
` fps view
` position camera & point it formards
` position camera 0,5,0
` point camera 50*cos(angle#),5,50*sin(angle#)
` endif
`if mode=1
` 3rd person view
` position camera and point it at the player
` position camera object position x(2)-(30*cos(angle#)),20,object position z(2)-(30*sin(angle#))
` point camera object position x(2),5,object position z(2)
` endif
` this is to toggle the mode
` if inkey$()=" " and keypress=0
` if mode=1
` mode=0
` mode$="First Person View"
` else
` mode=1
` mode$="3rd Person View"
` endif
`
` keypress=1
` endif
` if inkey$()="" and keypress=1
` so the player must release the mode key before u can change mode again
` keypress=0
` endif
` animate the scene
` angle#=angle#+0.125
` angle#=wrapvalue(angle#)
` this just turns the player to match the cam angle
` yrotate object 2,0-angle#
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#
`wait 1000
`sync on
`sync rate 60
`color backdrop rgb(0,0,0)
`hide mouse
`autocam off
`cx#=camera angle x(0):cy#=camera angle y(0)
` fps view
` position camera & point it formards
`position camera object position x()object position y()object position z()
` point camera 50*cos(angle#),5,50*sin(angle#)
` endif
position camera x#, 8, z#
xrotate camera 180
YROTATE CAMERA AY#
`point camera
`yrotate camera 90
`if yrotate object 4
`yrotate camera
`endif
`if yrotate object 1 then rotate cy
`endif
`do
rem clear the screen or you have lots of crosses
`cls
`get mouse x y
mx=mousex()
my=mousey()
rem draw line from x y
line mx-10 ,my ,mx+10 ,my
line mx ,my-10 ,mx ,my+10
rem update screen
`sync
`loop
IF MOUSECLICK()=1
play sound 3
endif
endif
if spacekey() = 0
rem reposition camera
`position camera 100, cy, -20
`point camera 0, cy, 0
stop object 3
set object frame 3,0
hide object 3
stop object 4
set object frame 4,23
hide object 4
position camera object position x(2)-(30*cos(angle#)),20,object position z(2)-(30*sin(angle#))
point camera object position x(2),5,object position z(2)
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)
rem rotate the player1
Yrotate object 1,aY#
yrotate object 2,ay#
yrotate object 3,ay#
yrotate object 4,ay#
` YROTATE CAMERA AY#
`yrotate object 2,0-angle#
` position camera and point it at the player
` position camera object position x(2)-(30*cos(angle#)),20,object position z(2)-(30*sin(angle#))
` point camera object position x(2),5,object position z(2)
sync
LOOP"[/code]