Can anyone tell me why either my hovercraft is upside down or my matrix is in the air
REM ***************************************************************
REM ***************************************************************
REM ***************************************************************
REM Straffing Hovercraft
REM Author :Ian George aka Vampyre
REM ****************************************************************
REM ****************************************************************
autocam off
hide mouse
sync off
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
rem Randomize the matrix
randomize matrix 1,125
X#=5000
Z#=5000
rem load hovercraft object
load object "HOVER1.X",2
rem Rotate and fix data so character faces right way
xrotate object 2,0
yrotate object 2,180
zrotate object 2,0
fix object pivot 2
rem Scale your object to double its width and depth, but not height
scale object 2,1200,1200,1200
rem movement
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 4,8
if joystick slider a()=65535 then move object 4,-8
if joystick twist z()=1000
X# = NEWXVALUE(X#,WRAPVALUE(aY#-90),1)
Z# = NEWZVALUE(Z#,WRAPVALUE(aY#-90),1)
endif
if joystick twist z()=-1000
X# = NEWXVALUE(X#,WRAPVALUE(aY#-180),1)
Z# = NEWZVALUE(Z#,WRAPVALUE(aY#-180),1)
endif
rem HAT control
jhat=joystick hat angle(0)
rem text 320,160,"HAT signal: "+str$(jhat)
rem **** use these lines below if you want the view to be immediate
rem **** and rem out the other lines that aren't needed
rem **** integrity checks for code alterations are included
rem turnview=0
rem if jhat=27000 or jhat=31500 then turnview=-90
rem if jhat=9000 or jhat=4500 then turnview=90
rem if jhat=18000 or jhat=13500 or jhat=22500 then turnview=180
rem horizontal view position
if turnview>0 and turnview<180 then turnview=turnview-2:if turnview<0 then turnview=0
if turnview>179 then turnview=turnview+2:if turnview>359 then turnview=0
if jhat=27000 or jhat=31500 or jhat=22500 then turnview=wrapvalue(turnview-4):if turnview>180 and turnview<220 then turnview=220
if jhat=9000 or jhat=4500 or jhat=13500 then turnview=wrapvalue(turnview+4):if turnview<180 and turnview>140 then turnview=140
rem vertical view position
if pitchview>0 and pitchview<180 then pitchview=pitchview-2:if pitchview<0 then pitchview=0
if pitchview>179 then pitchview=pitchview+2:if pitchview>359 then pitchview=0
if jhat=18000 or jhat=13500 or jhat=22500 then pitchview=wrapvalue(pitchview-4):if pitchview>180 and pitchview<280 then pitchview=280
if jhat=0 or jhat=4500 or jhat=31500 then pitchview=wrapvalue(pitchview+4):if pitchview<180 and pitchview>80 then pitchview=80
If InKey$() = "1" And cammode = 0 Then cammode = 1 : `Set the camera mode to third person
If InKey$() = "2" And cammode = 1 Then cammode = 0 : `Set the camera mode to first person
If cammode = 0
rem Place camera and set orientation to object
position camera object position x(2),object position y(2),object position z(2)
set camera to object orientation 2
EndIf
If cammode = 1
rem Place camera and set orientation to object
position camera object position x(3),object position y(3),object position z(3)
set camera to object orientation 3
Endif
rem now set turnview as needed for HAT control
turn camera right turnview
pitch camera up pitchview
rem and reset the camera view back to normal to center everything
turn camera left turnview
sync