I am trying to make this plane steer with a mouse but I can't seem to to it with this code what am I doing wrong now?
rem DARK BASIC EXAMPLE PROGRAM 18
rem ==========================================
rem This program shows free flight movement
rem ------------------------------------------
rem modified by Vampyre
autocam off
hide mouse
sync on
rem Make wire sky sphere
make object sphere 1,5000
set object 1,0,0,0
rem Load flying object
load object "AIRPL043.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 Make drone to mark a back position
make object sphere 3,10
rem Set camera range
set camera range 1,10000
rem Set text font
set text font "Arial"
ink rgb(255,255,0),0
set text size 30
rem Main loop
do
rem User prompt
center text 320,5,"FREE FLIGHT ORIENTATION"
center text 320,35,"Use ARROW KEYS to Turn and Pitch"
center text 320,60,"Use [<] and [>] to Roll"
center text 320,85,"Use LMB to Move"
center text 320,110,"Use SPACE to Reset"
rem Control free flight object
x=mousemovex(): y=mousemovey()
xangle#=camera angle x()
yangle#=camera angle y()
yangle#=wrapvalue(yangle#+x)
xangle#=wrapvalue(xangle#+y)
rotate camera xangle#,yangle#,0
if leftkey()=1 then roll object left 2,5
if rightkey()=1 then roll object right 2,5
if upkey()=1 then move camera 20 : move object 2,20
If InKey$() = "15" then move camera 20 : move object 2,100
if spacekey()=1 then rotate object 2,0,0,0
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 2
EndIf
rem Get back position of object for camera
move object 2,-150
position object 3,object position x(2),object position y(2),object position z(2)
move object 2,150
rem Update screen
sync
loop