I'm just going to post the whole code, if it lets me post all of it.
` Array Information
` ----------------------------------------------------------------------------------------------------------------
` LoadedPlane is used for the selection screen. That way the number can be changed within the game, and not
` Hard coded. Its the main number for the arrays.
` Numbers must match for Object as well.
` 0 = ZX-22 in Planes, and 0 is the array for ZX-22 In Object# properties.
`
` LP is so that there is a plane that is loaded by default. 0 = ZX22, thus loading ZX22.
LP=0
` ZX22 and SN305 is used in the Planes$ Array. This loads the planes, and can be used to show what plane
` the user is flying.
ZX22=0
SN305=1
Dim Planes$(1)
Planes$(0)="ZX-22"
Planes$(1)="SN305"
` Plane Data Arrays
Weight=0
MaxSpeed=1
MaxAft=2
PitchRate=3
TurnRate=4
RollRate=5
Dim PlaneData#(1,5)
PlaneData#(0,0)=25000
PlaneData#(0,1)=10
PlaneData#(0,2)=15
PlaneData#(0,3)=1
PlaneData#(0,4)=1.75
PlaneData#(0,5)=1.5
PlaneData#(1,0)=17000
PlaneData#(1,1)=80
PlaneData#(1,2)=100
PlaneData#(1,3)=1.25
PlaneData#(1,4)=1.5
PlaneData#(1,5)=2
` World Data
Gravity=0
Dim World#(0)
World#(0)=3.69
` Camera Data
Follow=0
MoveForward=1
MoveBackward=2
Dim CameraData#(2)
CameraData#(0)=1
CameraData#(1)=50
CameraData#(2)=-50
` Fog Data
Distance=0
Color=1
Dim Fog(1)
Fog(0)=10000
Fog(1)=128
` ----------------------------------------------------------------------------------------------------------------
` Initialize Data
GoSub StartupSettings
GoSub InitializeWorld
GoSub InitializeFog
GoSub InitializeCamera
GoSub LoadPlane
Load Object "Airport.x",2
Position Object 2,250050.0,150.0,250050.0
` ----------------------------------------------------------------------------------------------------------------
` Start Loop and what ever...
Sync On
Do
` Show Debugs
GoSub ShowFPS
GoSub ShowPlaneSettings
GoSub ShowPlaneCoords
GoSub ShowPlaneAngles
GoSub ObjectSizing
` Plane Movement
If DownKey()=1 Then Pitch Object Up 1,1
If UpKey()=1 Then Pitch Object Down 1,1
If LeftKey()=1 Then Turn Object Left 1,1.75
If RightKey()=1 Then Turn Object Right 1,1.75
If InKey$()="," Then Roll Object Left 1,1.5
If InKey$()="." Then Roll Object Right 1,1.5
` Speed Adjustments
If Inkey$()="0" Then Speed#=PlaneData#(LP,MaxSpeed)*0
If InKey$()="1" Then Speed#=PlaneData#(LP,MaxSpeed)*0.10
If InKey$()="2" Then Speed#=PlaneData#(LP,MaxSpeed)*0.25
If InKey$()="3" Then Speed#=PlaneData#(LP,MaxSpeed)*0.30
If InKey$()="4" Then Speed#=PlaneData#(LP,MaxSpeed)*0.40
If InKey$()="5" Then Speed#=PlaneData#(LP,MaxSpeed)*0.50
If InKey$()="6" Then Speed#=PlaneData#(LP,MaxSpeed)*0.60
If InKey$()="7" Then Speed#=PlaneData#(LP,MaxSpeed)*0.75
If InKey$()="8" Then Speed#=PlaneData#(LP,MaxSpeed)*0.80
If InKey$()="9" Then Speed#=PlaneData#(LP,MaxSpeed)*1
If InKey$()="p" Then Speed#=PlaneData#(LP,MaxAft)
If InKey$()="-" Then Dec Speed#,0.25 : If Speed#<0 Then Speed#=0
If InKey$()="=" Then Inc Speed#,0.25 : If Speed#>50 Then Speed#=60
` Camera Control
If InKey$()="w" Then Pitch Camera Up 2.5
If InKey$()="s" Then Pitch Camera Down 2.5
If InKey$()="a" Then Turn Camera Left 2.5
If InKey$()="d" Then Turn Camera Right 2.5
If InKey$()="q" Then Roll Camera Left 2.5
If InKey$()="e" Then Roll Camera Right 2.5
If InKey$()="r" Then Move Camera CameraData#(MoveForward)
If InKey$()="f" Then Move Camera CameraData#(MoveBackward)
If InKey$()="z" Then CameraData#(Follow)=1
If InKey$()="x" Then CameraData#(Follow)=0
` Camera
If CameraData#(Follow)=1
SetCameraToFollow(1,15.0,10.0,2.0)
EndIf
` Check Points
GoSub GravityCheck
GoSub HeightCheck
GoSub PositionCheck
` Refresh screen
Sync
Loop
` ----------------------------------------------------------------------------------------------------------------
` Labels
StartupSettings:
` Reset Lift and Speed at Startup.
Lift#=0
Speed#=0
Return
InitializeWorld:
` Startup the world and Display
Set Display Mode 1024,768,32
Hide Mouse
Make Matrix 1,500000.0,500000.0,50,50
Load Bitmap "ground.bmp",1
Get Image 1,0,0,1024,768,32
Delete Bitmap 1
Prepare Matrix Texture 1,1,2,2
Fill Matrix 1,0.0,1
Randomize Matrix 1,250
Color BackDrop 128
Return
InitializeFog:
Fog On
Fog Distance Fog(Distance)
Fog Color Fog(Color)
Return
InitializeCamera:
Set Camera Range 1,50000
Return
LoadPlane:
` Load Player Object
Load Object Planes$(LP)+".x",1
YRotate Object 1,180
Fix Object Pivot 1
Position Object 1,250000.0,100.0,250000.0
Return
GravityCheck:
` Define Variables
x#=1
L#=(((PlaneData#(LP,Weight)/1000)*World#(Gravity))/2)
If Speed#<#L Then L#=L#*100 Else L#=L#/1000
PY#=(Speed#*L#)-World#(Gravity)
Position Object x#, Object Position X(x#), Object Position Y(x#)+PY#, Object Position Z(x#)
Move Object 1,Speed#
Return
HeightCheck:
` Ground Collision
GrndHeight# = int(Get Ground Height(1,PosX#,PosZ#)+5.0)
If Object Position Y(1)<GrndHeight#
` Speed#=PlaneData#(LP,MaxSpeed)*0
Position Object 1,PosX#,GrndHeight#,PosZ#
EndIf
Return
PositionCheck:
OldPosX#=Object Position x(1)-200
OldPosY#=Object Position y(1)
OldPosZ#=Object Position z(1)
PosX#=Object Position X(1)
PosY#=Object Position Y(1)
PosZ#=Object Position Z(1)
Return
ShowFPS:
Frames$=str$(Screen FPS())
Text 1,1, Frames$
Return
ShowPlaneSettings:
strSpeed$=str$(Speed#)
cSHPSpeed$="Speed Setting: "+strSpeed$
Text 1,16, cSHPSpeed$
return
ShowPlaneCoords:
` Plane Coords
cSHPPosition$="World Coords: X; "+str$(PosX#)+" Z; "+str$(PosZ#)+" Y; "+str$(PosY#)
Text 1,31, cSHPPosition$
Return
ShowPlaneAngles:
` Plane Angles
strAngleX$=str$(Object Angle X(1))
strAngleZ$=str$(Object Angle Z(1))
strAngleY$=str$(Object Angle Y(1))
strPlaneAngles$="Plane Angles: X; "+strAngleX$+" Z; "+strAngleZ$+" Y; "+strAngleY$
Text 1,47, strPlaneAngles$
Return
ObjectSizing:
Width$=str$(Object Size x(1))
Length$=str$(Object Size z(1))
Height$=str$(Object Size y(1))
Text 1,63, "X: "+Width$+" Y: "+Height$+" Z: "+Length$
Return
` ----------------------------------------------------------------------------------------------------------------
` Functions
Function SetCameraToFollow(Num,Dist#,Height#,Smooth#)
X#=Object Position X(Num)
Y#=Object Position Y(Num)
Z#=Object Position Z(Num)
A#=Object Angle Y(Num)
Set Camera To Follow X#,Y#,Z#,A#,Dist#,Height#+Y#,Smooth#,1
Point Camera X#,Y#,Z#
EndFunction
-------------
I'm Batman....