I have a nestling error at line 877, why is this it was all working before? Still if you have Dark Matter then you should have the Babe model, should be in the Babe x folder, I have put the aircraft and hovercraft models as testbox so that you can use your own 3d testbox model, if not use the hover1 model and the airplan043 model from the Dark Basic models that came with Dark Basic
]REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM Solar Dominion in and Out of Vehicle Test
REM Author :Ian George aka Vampyre
REM Revised and additional code by : Shaun Bowers aka Vice&Chris Montgomery
REM Additional Coding Help Jess Ticular
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
autocam off
hide mouse
sync rate 60
sync on
REM Variables
invehicle = 0
player = 1
dim idle(20,2) : dim attack1(20,2) : dim move(20,2) : dim Impact(20,2) : dim die(20,2) : dim Static(20,2)
Rem Backdrop On
Backdrop on
REM FOG
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 "grass09.bmp",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1
gosub _LoadObjects
cammode = 1 : ` third person
REM ------------------------------ MAIN PROGRAM LOOP -------------------------------------------
do
` Gosub _playerview
if cammode = 1 : ` third person
Gosub _Follow
position object 3,camera position x(),camera position y(),camera position z()
else
position object 3,camera position x(),camera position y(),camera position z()
set object to camera orientation 3
move object 3,9
endif
gosub _Input
gosub _UpdateVehicle
if cammode = 0 and inVehicle = 0
if object collision(3,hover) = 1 then inVehicle = 2 : set camera to object orientation hover
if object collision(3,plane) = 1 then inVehicle = 1 : set camera to object orientation plane
endif
if inVehicle = 0 then gosub _MovePlayer
if inVehicle = 1 then center text screen width() / 2,10,"In plane." : hide object player
if inVehicle = 2 then center text screen width() / 2,10,"In hover." : hide object player
if ks45 = 1 : ` pressed X
if inVehicle = 1
` normally, you would gradually slow the vehicle down and then have the player get out of it
x# = object position x(plane)
y# = object position y(plane)
z# = object position z(plane)
y# = get ground height(1,x# + 40,z# + 40)
position object player,(x# + 40),y#,(z# + 40)
show object player
endif
if inVehicle = 2
` normally, you would gradually slow the vehicle down and then have the player get out of it
x# = object position x(hover)
y# = object position y(hover)
z# = object position z(hover)
y# = get ground height(1,x# + 40,z#)
position object player,(x# + 40),y#,(z# + 40)
show object player
endif
inVehicle = 0 : cammode = 1
endif
gosub _HUD
sync
loop
REM ------------------------------ MAIN PROGRAM LOOP -------------------------------------------
camode=0
inVehicle = 0
` =0 human =1 hovercraft =2 airplane
playerView = 0
end
_Playerview:
if inVehicle = 1 then obj = plane
if inVehicle = 2 then obj = hover
x# = object position x(PLAYER)
y# = object position y(PLAYER)
z# = object position z(PLAYER)
ya# = object angle y(PLAYER)
` position camera object position x(player),object position y(player)+40,object position z(player)
` set camera to object orientation player
return
_Follow:
obj = player
if inVehicle = 1 then obj = plane
if inVehicle = 2 then obj = hover
x# = object position x(obj)
y# = object position y(obj)
z# = object position z(obj)
ya# = object angle y(obj)
`ya# = wrapvalue(ya# + 15.0)
set camera to follow x#,y#,z#,ya#,20.0,1,4,6
return
_UpdateVehicle:
select inVehicle
case 1
` in airplane
gosub _UpdateAircraft
gosub _UpdateCockpit2
endcase
case 2
` in hover
gosub _UpdateHovercraft
` in hover
gosub _UpdateCockpit
endcase
endselect
return
_UpdateHovercraft:
rem hovercraft controls
if invehicle=2
if cammode = 0 then hide object player
if cammode = 0 then hide object 2
if cammode = 1 then show object 2
if cammode = 1 then hide object 5
mmy=mousemovey()
mmx=mousemovex()
if mmy>0 then pitch object up 2,0.002
if mmy<0 then pitch object down 2,0.002
if mmx<0 then turn object left 2,5
if mmx>0 then turn object right 2,5
if upkey()=1 then move object 2,4
if downkey()=1 then move object 2,-4
if scancode()=17 then move object 2,4
if scancode()=31 then move object 2,-4
if joystick up()=1 then pitch object up 2,0.0002
if joystick down()=1 then pitch object down 2,0.0002
if joystick left()=1 then turn object left 2,5
if joystick right()=1 then turn object right 2,5
if joystick slider a()=0 then move object 2,4
if joystick slider a()=65535 then move object 2,-4
REM Straffe Left
if joystick twist z()=-1000 then turn object left 2,90 : move object 2,20 : turn object right 2,90
REM Straffe Right
if joystick twist z()=1000 then turn object right 2,90 : move object 2,20 : turn object left 2,90
REM Straffe Left
if scancode()=30 then turn object left 2,90 : move object 2,20 : turn object right 2,90
REM Straffe Right
if scancode()=32 then turn object right 2,90 : move object 2,20 : turn object left 2,90
REM Straffe Left
if leftkey()=1 then turn object left 2,90 : move object 2,20 : turn object right 2,90
REM Straffe Right
if rightkey()=1 then turn object right 2,90 : move object 2,20 : turn object left 2,90
REM Hovercaft Jump
if jumpb=1 then height#=height#-0.7
if joystick fire x(4) or spacekey()=1
if ajump=1
jumpb=1
height#=20
endif
endif
if height#<-13 then height#=-13
if object position y(2)>100 then ajump=0 else ajump=1
position object 2,object position x(2),object position y(2)+height#,object position z(2)
if object position y(2)<10 then jumpb=0:height#=0
if cammode = 0
x# = object position x(hover)+60
y# = object position y(hover)+60.0
z# = object position z(hover)+60
position camera x#,y#,z#
set camera to object orientation hover
move camera -5
if ksNum8 = 1 or jhat = 0 : ` numpad 8 key -- look forward
position camera object position x(hover),object position y(hover),object position z(hover)+60
set camera to object orientation hover
endif
if ksNum4 = 1 or jhat = 27000 : ` numpad 4 key -- look left
position camera object position x(hover),object position y(hover),object position z(hover)+60
set camera to object orientation hover
yrotate camera wrapvalue(camera angle y() - 90.0)
endif
if ksNum6 = 1 or jhat = 9000 : ` numpad 6 key -- look right
position camera object position x(hover),object position y(hover),object position z(hover)+60
set camera to object orientation hover
yrotate camera wrapvalue(camera angle y() + 90.0)
endif
if ksNum2 = 1 or jhat = 18000 : ` numpad 2 key -- look backward
position camera object position x(hover),object position y(hover),object position z(hover)+60
set camera to object orientation hover
yrotate camera wrapvalue(camera angle y() - 180.0)
endif
endif
endif
return
_UpdateCockpit:
rem hovercraft controls
if invehicle=2
if cammode = 0 then hide object player
if cammode = 0 then hide object cockpit
if cammode = 1 then show object 2
mmy=mousemovey()
mmx=mousemovex()
if mmy>0 then pitch object up 5,0.002
if mmy<0 then pitch object down 5,0.002
if mmx<0 then turn object left 5,5
if mmx>0 then turn object right 5,5
if upkey()=1 then move object 5,4
if downkey()=1 then move object 5,-4
if scancode()=17 then move object 5,4
if scancode()=31 then move object 5,-4
if joystick up()=1 then pitch object up 5,0.0002
if joystick down()=1 then pitch object down 5,0.0002
if joystick left()=1 then turn object left 5,5
if joystick right()=1 then turn object right 5,5
if joystick slider a()=0 then move object 5,4
if joystick slider a()=65535 then move object 5,-4
REM Straffe Left
if joystick twist z()=-1000 then turn object left 5,90 : move object 5,20 : turn object right 5,90
REM Straffe Right
if joystick twist z()=1000 then turn object right 5,90 : move object 5,20 : turn object left 5,90
REM Straffe Left
if scancode()=30 then turn object left 5,90 : move object 5,20 : turn object right 5,90
REM Straffe Right
if scancode()=32 then turn object right 5,90 : move object 5,20 : turn object left 5,90
REM Straffe Left
if leftkey()=1 then turn object left 5,90 : move object 5,20 : turn object right 5,90
REM Straffe Right
if rightkey()=1 then turn object right 5,90 : move object 5,20 : turn object left 5,90
REM Hovercaft Jump
if jumpb=1 then height#=height#-0.7
if joystick fire x(4) or spacekey()=1
if ajump=1
jumpb=1
height#=20
endif
endif
if height#<-13 then height#=-13
if object position y(5)>100 then ajump=0 else ajump=1
position object 5,object position x(5),object position y(5)+height#,object position z(5)
if object position y(5)<10 then jumpb=0:height#=0
if cammode = 0
x# = object position x(hover)
y# = object position y(hover)+6.0
z# = object position z(hover)
position camera x#,y#,z#
set camera to object orientation hover
move camera -5
if ksNum8 = 1 or jhat = 0 : ` numpad 8 key -- look forward
position camera object position x(cockpit),object position y(cockpit),object position z(hover)+60
set camera to object orientation cockpit
endif
if ksNum4 = 1 or jhat = 27000 : ` numpad 4 key -- look left
position camera object position x(hover),object position y(cockpit),object position z(hover)+60
set camera to object orientation cockpit
yrotate camera wrapvalue(camera angle y() - 90.0)
endif
if ksNum6 = 1 or jhat = 9000 : ` numpad 6 key -- look right
position camera object position x(hover),object position y(cockpit),object position z(hover)+60
set camera to object orientation cockpit
yrotate camera wrapvalue(camera angle y() + 90.0)
endif
if ksNum2 = 1 or jhat = 18000 : ` numpad 2 key -- look backward
position camera object position x(hover),object position y(cockpit),object position z(hover)+60
set camera to object orientation cockpit
yrotate camera wrapvalue(camera angle y() - 180.0)
endif
endif
endif
_UpdateAircraft:
rem air/spacecraft movement controls
if inVehicle = 1
if cammode = 0 then hide object player
mmy=mousemovey()
mmx=mousemovex()
if mmy>0 then pitch object up 4,2
if mmy<0 then pitch object down 4,2
if mmx<0 then turn object left 4,5
if mmx>0 then turn object right 4,5
if upk = 1 or ks17 = 1 then move object plane,2 : ` W
if dnk = 1 or ks31 = 1 then move object plane,-2 : ` S
if ks16 = 1 then roll object left plane,2 :` Q
if ks18 = 1 then roll object right plane,2 : ` E
if scancode()=211 then roll object left 4,2
if scancode()=209 then roll object right 4,2
if Joystick Up() = 1 then pitch object down 4,2
if Joystick Down() = 1 then pitch object up 4,2
if Joystick Left() = 1
turn object left 4,2 : turn camera left 2
set camera to object orientation plane
endif
if Joystick Right() = 1
turn object right 4,2 : turn camera right 2
set camera to object orientation plane
endif
if Joystick Twist Z() = 1000 then roll object left 4,2
if Joystick Twist Z()= -1000 then roll object right 4,2
if Joystick Slider A() = 0 then move object 4,2
if Joystick Slider A() = 65535 then move object 4,-2
REM Straffe Left
if joystick fire x(4)=1 or lfk = 1 or ks30 = 1
turn camera left 90.0 : move camera 5 : turn camera right 90.0
turn object left plane,90 : move object plane,5 : turn object right plane,90
endif
REM Straffe Right
if joystick fire x(5)=1 or rgk = 1 or ks32 = 1
turn object right plane,90 : move object plane,5 : turn object left plane,90
turn camera right 90 : move camera 5 : turn camera left 90
endif
rem VTOL take off and landing
if joystick fire x(6) = 1 or control = 1
position object plane,object position x(4),object position y(4)+height,object position z(4):height=10
endif
if joystick fire x(7) or SPACE = 1
position object plane,object position x(plane),object position y(plane)-10,object position z(plane):height=height-1
endif
x# = object position x(plane)
y# = object position y(plane) + 5.0
z# = object position z(plane)
position camera x#,y#,z#
position camera object position x(plane),object position y(plane),object position z(plane)
set camera to object orientation plane
move camera -5
if ksNum8 = 1 or jhat = 0 : ` numpad 8 key -- look forward
position camera object position x(plane),object position y(plane),object position z(plane)
set camera to object orientation plane
endif
if ksNum4 = 1 or jhat = 27000 : ` numpad 4 key -- look left
position camera object position x(plane),object position y(plane),object position z(plane)
set camera to object orientation plane
yrotate camera wrapvalue(camera angle y() - 90.0)
endif
if ksNum6 = 1 or jhat = 9000 : ` numpad 6 key -- look right
position camera object position x(plane),object position y(plane),object position z(plane)
set camera to object orientation plane
yrotate camera wrapvalue(camera angle y() + 180.0)
endif
if ksNum2 = 1 or jhat = 18000 : ` numpad 2 key -- look backward
position camera object position x(plane),object position y(plane),object position z(plane)
set camera to object orientation plane
yrotate camera wrapvalue(camera angle y() - 180.0)
endif
endif
return
_UpdateCockpit2:
rem air/spacecraft Guide cockpit movement controls
if inVehicle = 1
if cammode = 0 then hide object player
if cammode = 0 then hide object cockpit2
if cammode = 0 then hide object plane
if cammode = 1 then show object plane
if cammode = 1 then hide object cockpit2
mmy=mousemovey()
mmx=mousemovex()
if mmy>0 then pitch object up 6,2
if mmy<0 then pitch object down 6,2
if mmx<0 then turn object left 6,5
if mmx>0 then turn object right 6,5
if upk = 1 or ks17 = 1 then move object cockpit2,2 : ` W
if dnk = 1 or ks31 = 1 then move object cockpit2,-2 : ` S
if ks16 = 1 then roll object left cockpit2,2 :` Q
if ks18 = 1 then roll object right cockpit2,2 : ` E
if scancode()=211 then roll object left 6,2
if scancode()=209 then roll object right 6,2
if Joystick Up() = 1 then pitch object down 6,2
if Joystick Down() = 1 then pitch object up 6,2
if Joystick Left() = 1
turn object left 6,2 : turn camera left 2
set camera to object orientation plane
endif
if Joystick Right() = 1
turn object right 6,2 : turn camera right 2
set camera to object orientation plane
endif
if Joystick Twist Z() = 1000 then roll object left 6,2
if Joystick Twist Z()= -1000 then roll object right 6,2
if Joystick Slider A() = 0 then move object 6,2
if Joystick Slider A() = 65535 then move object 6,-2
REM Straffe Left
if joystick fire x(4)=1 or lfk = 1 or ks30 = 1
turn camera left 90.0 : move camera 5 : turn camera right 90.0
turn object left cockpit2,90 : move object cockpit2,5 : turn object right cockpit2,90
endif
REM Straffe Right
if joystick fire x(5)=1 or rgk = 1 or ks32 = 1
turn object right cockpit2,90 : move object cockpit2,5 : turn object left cockpit2,90
turn camera right 90 : move camera 5 : turn camera left 90
endif
rem VTOL take off and landing
if joystick fire x(6) = 1 or control = 1
position object cockpit2,object position x(4),object position y(4)+height,object position z(4):height=10
endif
if joystick fire x(7) or SPACE = 1
position object cockpit2,object position x(cockpit2),object position y(cockpit2)-10,object position z(cockpit2):height=height-1
endif
x# = object position x(cockpit2)
y# = object position y(cockpit2)
z# = object position z(cockpit2)
`position camera x#,y#,z#
`position camera object position x(cockpit2),object position y(cockpit2),object position z(cockpit2)
`set camera to object orientation cockpit2
rem Place as over head for 3rd person
move object cockpit2,-50
position object 3,object position x(cockpit2),object position y(cockpit2),object position z(cockpit2)
move object cockpit2,50
move camera -5
if ksNum8 = 1 or jhat = 0 : ` numpad 8 key -- look forward
position camera object position x(cockpit2),object position y(cockpit2),object position z(cockpit2)
set camera to object orientation cockpit2
endif
if ksNum4 = 1 or jhat = 27000 : ` numpad 4 key -- look left
position camera object position x(cockpit2),object position y(cockpit2),object position z(cockpit2)
set camera to object orientation cockpit2
yrotate camera wrapvalue(camera angle y() - 90.0)
endif
if ksNum6 = 1 or jhat = 9000 : ` numpad 6 key -- look right
position camera object position x(cockpit2),object position y(cockpit2),object position z(cockpit2)
set camera to object orientation cockpit2
yrotate camera wrapvalue(camera angle y() + 180.0)
endif
if ksNum2 = 1 or jhat = 18000 : ` numpad 2 key -- look backward
position camera object position x(cockpit2),object position y(cockpit2),object position z(cockpit2)
set camera to object orientation cockpit2
yrotate camera wrapvalue(camera angle y() - 180.0)
endif
_UpdateCam:
if inVehicle = 0
if playerView = 0
camX# = playerX#
camY# = playerY# + 2.5
camZ# = playerZ#
camAngX# = playerAngX#
camAngY# = playerAngY#
else
camX# = newxvalue(object1X#,wrapvalue(object1AngY#+180.0),25.0)
camY# = newyvalue(object1Y#,playerAngX#,-25.0)
camZ# = newzvalue(object1Z#,wrapvalue(playerAngY#+180.0),25.0)
camAngX# = playerAngX#
camAngY# = playerAngY#
endif
endif
if inaircraft = 1
if playerView = 0
camX# = playerX#
camY# = playerY# + 2.5
camZ# = playerZ#
camAngX# = 0.0
camAngY# = aircraftAngY#
else
camX# = newxvalue(aircraftX#,wrapvalue(aircraftAngY#+180.0),25.0)
camY# = newyvalue(object1Y#,playerAngX#,-25.0)
camZ# = newzvalue(aircraftyZ#,wrapvalue(aircraftAngY#+180.0),25.0)
camAngX# = playerAngX#
camAngY# = aircraftAngY#
endif
endif
position camera camX#,camY#,camZ#
rotate camera camAngX#,camAngY#,0.0
if invehicle = 1 or inVehicle = 2
if playerView = 0
camX# = playerX#
camY# = playerY#
camZ# = playerZ# + 12.5
camAngX# = 0.0
camAngY# = hovercraftAngY#
else
camX# = newxvalue(hovercraftX#,wrapvalue(hovercraftAngY#+180.0),25.0)
camY# = newyvalue(playerY#,playerAngX#,-25.0)
camZ# = newzvalue(hovercraftyZ#,wrapvalue(hovercraftAngY#+180.0),25.0)
camAngX# = playerAngX#
camAngY# = hovercraftAngY#
endif
position camera camX#,camY#,camZ#
rotate camera camAngX#,camAngY#,0.0
endif
return
_Input:
REM get status of all of the keys
upk = upkey() : dnk = downkey()
lfk = leftkey() : rgk = rightkey()
jhat = joystick hat angle(0)
jfx4 = joystick fire x(4) : jfx5 = joystick fire x(5)
jfx6 = joystick fire x(6) : jfx7 = joystick fire x(7)
ks1 = keystate(2) : if ks1 = 1 then cammode = 1 : ` 1 third person
ks2 = keystate(3) : if ks2 = 1 then cammode = 0 : ` 2 first person
ks30 = keystate(30) : ` A
ks32 = keystate(32) : ` D
ks17 = keystate(17) : ` w
ks31 = keystate(31) : ` S
ks16 = keystate(16) : ` Q
ks18 = keystate(18) : ` E
ks211 = keystate(211) : ` DELETE key
ks209 = keystate(209) : ` PageDown key`
ks45 = keystate(45) : ` X
ksNum8 = keystate(72) : ` 8 on numpad
ksNum4 = keystate(75) : ` 4 on numpad
ksNum6 = keystate(77) : ` 6 on numpad
ksNum2 = keystate(80) : ` 2 on numpad
control = controlkey()
JoyUp = joystick up()
JoyDown = joystick down()
JoyLeft = joystick left()
JoyRight =joystick right()
JoyTZ = joystick twist z()
JoySlideA = joystick slider a()
SPACE = spacekey()
return
_MovePlayer:
if cammode = 0 : ` first person
if inVehicle = 0
hide object player
ax# = wrapvalue(ax# + mousemovey() )
ay# = wrapvalue(ay# + mousemovex() )
rotate camera ax#,ay#,0
cx# = camera angle x() : cy# = camera angle y() : cz# = camera angle z()
endif
else
` third person
if inVehicle = 0 then show object player
endif
if inVehicle > 0 then exitfunction
ay# = wrapvalue(ay# + mousemovex() )
rotate object player, ax#,ay#,0
cx# = camera angle x() : cy# = camera angle y() : cz# = camera angle z()
If upkey() = 1 : ` W key
if cammode = 0
rotate camera 0.0,cy#,cz#
move camera .3
rotate camera cx#,cy#,cz#
else
move object player,.3
if object playing(player) = 0
play object player,move(1,1),move(1,2)
endif
endif
endif
if keystate(17) = 1
if cammode = 0
rotate camera 0.0,cy#,cz#
move camera .3
rotate camera cx#,cy#,cz#
else
move object player,.3
if object playing(player) = 0
play object player,move(1,1),move(1,2)
endif
endif
endif
if Joystick Slider a() = 0 : ` W key
if cammode = 0
rotate camera 0.0,cy#,cz#
move camera .3
rotate camera cx#,cy#,cz#
else
move object player,.3
if object playing(player) = 0
play object player,move(1,1),move(1,2)
endif
endif
endif
if downkey() = 1 : ` S key
if cammode = 0
rotate camera 0.0,cy#,cz#
move camera -.3
rotate camera cx#,cy#,cz#
else
move object player,-.3
if object playing(player) = 0
play object player,move(1,1),move(1,2)
endif
endif
endif
if keystate(31)
if cammode = 0
rotate camera 0.0,cy#,cz#
move camera -.3
rotate camera cx#,cy#,cz#
else
move object player,-.3
if object playing(player) = 0
play object player,move(1,1),move(1,2)
endif
endif
endif
if Joystick slider a()=65535 : ` S key
if cammode = 0
rotate camera 0.0,cy#,cz#
move camera -.3
rotate camera cx#,cy#,cz#
else
move object player,-.3
if object playing(player) = 0
play object player,move(1,1),move(1,2)
endif
endif
endif
if leftkey() = 1 :` A
y# = camera angle y()
if cammode = 1
turn object left player,90
move object player,0.3
turn object right player,90
if object playing(player) = 0
play object player,move(1,1),move(1,2)
endif
endif
endif
if keystate(30) = 1 : ` A
y# = camera angle y()
if cammode = 1
turn object left player,90
move object player,0.3
turn object right player,90
if object playing(player) = 0
play object player,move(1,1),move(1,2)
endif
endif
endif
if Joystick Twist Z()=-1000 : ` A
y# = camera angle y()
if cammode = 1
turn object left player,90
move object player,0.3
turn object right player,90
if object playing(player) = 0
play object player,move(1,1),move(1,2)
endif
endif
endif
if rightkey() = 1 : ` D
y# = camera angle y()
if cammode = 1
turn object right player,90
move object player,0.3
turn object left player,90
if object playing(player) = 0
play object player,move(1,1),move(1,2)
endif
endif
endif
if keystate(32)= 1 : ` D
y# = camera angle y()
if cammode = 1
turn object right player,90
move object player,0.3
turn object left player,90
if object playing(player) = 0
play object player,move(1,1),move(1,2)
endif
endif
endif
if Joystick twist z() =1000:` D
y# = camera angle y()
if cammode = 1
turn object right player,90
move object player,0.3
turn object left player,90
if object playing(player) = 0
play object player,move(1,1),move(1,2)
endif
endif
endif
if inVehicle = 0
if cammode = 1
` check collision with player to plane and hovercraft
if object collision(player,hover) = 1 then inVehicle = 2 : hide object player
if object collision(player,plane) = 1 then inVehicle = 1 : hide object player
endif
endif
if inVehicle = 0
if cammode = 0
` check collision with player to plane and hovercraft
if object collision(player,hover) = 1 then inVehicle = 2 : hide object player
if object collision(player,plane) = 1 then inVehicle = 1 : hide object player
endif
endif
if jumpb=1 then height#=height#-0.7
if joystick fire x(4) or spacekey()=1
if ajump=1
jumpb=1
height#=20
endif
endif
return
_LoadObjects:
rem Make drone to mark a back position
make object sphere 3,10
hide object 3
set object collision on 3
make object collision box 3,-5,-5,-5,5,5,5,1
player = 1
REM player object
LOAD OBJECT "BabeH-Babe-Idle.x",player
frames = total object frames(player)
idle(1,1) = 1 : idle(1,2) = frames
append object "BabeH-Babe-Attack1.x",player,frames + 1
attack1(1,1) = frames +1
frames = total object frames(player)
attack1(1,2) = frames
append object "BabeH-Babe-move.x",player,frames + 1
move(1,1) = frames + 1
frames = total object frames(player)
move(1,2) = frames
append object "BabeH-Babe-Impact.x",player,frames + 1
Impact(1,1) = frames + 1
frames = total object frames(player)
Impact(1,2) = frames
append object "BabeH-Babe-Die.x",player,frames + 1
Die(1,1) = frames + 1
frames = total object frames(player)
Die(1,2) = frames
append object "BabeH-Babe-Static.x",player,frames + 1
Static(1,1) = frames + 1
frames = total object frames(player)
Static(1,2) = frames
set object speed player,30
SCALE OBJECT player,300,300,300
YROTATE OBJECT player,180
FIX OBJECT PIVOT player
set object collision on player
make object collision box player,-2,-2,-2,2,2,2,1
REM Get Ground Height
x# = 100.0
z# = 100.0
Y# = Get ground height(1,X#,Z#)
Position object player, X#,Y#,Z#
cy# = get ground height(1,0,0)
position camera 0,cy# + 1.5,0
plane = 4
REM Aircraft Object
load object "testbox1.X", plane
scale object plane,200,200,200
REM Object Collisions
Set object collision to spheres plane
set object collision on plane
rem Rotate and fix data so character faces right way
rotate object plane,0,180,0
fix object pivot plane
x# = 200.0
z# = 200.0
Position object plane, X#,Y# + 1.54,Z#
make object collision box plane,-28,-8,-12,32,8,12,1
rem Hovercraft Object
hover = 2
load object "testbox.3ds",hover
scale object hover,50,50,50
rem Rotate and fix data so character faces right way
rotate object hover,0,260,0
fix object pivot hover
X# = 150.0
z# = 150.0
REM Get Ground Height
Y# = Get ground height(1,X#,Z#)
Position object hover, X#,Y#,Z#
set object collision on hover
make object collision box hover,-30,-4,-32,10,4,32,2
_ShowAnimations:
text 10,10,"Press F1 to see die animation"
text 10,30,"Press F2 to see Attack1 animation."
text 10,50,"Press F3 to see Move animation."
text 10,70,"Press F4 to see Static animation."
text 10,90,"Press F5 to see Impact animation."
if object playing(player) = 1 then stop object player
if keystate(59) = 1 then play object player,die(1,1),die(1,2)
if keystate(60) = 1 then play object player,attack1(1,1),attack1(1,2)
if keystate(61) = 1 then play object player,move(1,1),move(1,2)
if keystate(62) = 1 then play object player,static(1,1),static(1,2)
if keystate(63) = 1 then play object player,impact(1,1),impact(1,2)
return
_HUD:
print westminster
text 10,10,"HAT signal: "+str$(jhat)
text 10,20,"Joystick: "+str$(jx)+"/"+str$(jy)
text 10,30,"Slider: "+str$(joystick slider a())
text 10,40,"FPS: "+str$(screen fps())
text 320,400,"Speed: "+str$(intspeed)+"MPH"
return