Working on the warp drive for my space game. Normal movement all seems fine, though when I try anything in the thousands for the movement(warp)speed the camera veiw starts to become unstable. Even if I stop the object the camera movement continues to be very jumpy.
Seems to start roughly arround 1000 movement.
As the game will involve ship moving over AU (Astronomical Units) in a single solar system (and not between solar systems) I would really like to keep the full veiw while in and out of warp instead of a silly loading screen when warping between positions.
Controls are listed at beginning of code in REM statements, though most important to see what I am talking about is 1 for warp acceleration and mouse movement for camera veiw.
REM Controls
REM W = pitch down
REM S = pitch up
REM A = turn left
REM D = turn right
REM Q = roll left
REM E = roll right
REM left mouseclick = camera zoom out
REM right mouseclick = camera zoom in
REM mousemove = camera movement
REM spacebar = acceleration (releasing slows down)
REM 1 = warp acceleration
REM 2 = stop
REM ***** Main Source File *****
SYNC ON:SYNC RATE 0
set display mode 1280,800,32
set camera range 1,999999999
REM player object
make object cube 1,1
position object 1,0,0,0
REM planetoids and beacons
REM planetoid 1 and beacon 1
make object cone 2,1
position object 2,10,10,10
color object 2, rgb(0,150,0)
make object sphere 3,4000
position object 3, object position x(2)-5000, object position y(2)-5000, object position z(2)-5000
color object 3, rgb(0,255,0)
REM planetoid 2 and beacon 2
make object cone 4,1
position object 4,5000,5000,5000
color object 4, rgb(0,150,0)
make object sphere 5,4000
position object 5, object position x(4)-5000, object position y(4)-5000, object position z(4)-5000
color object 5, rgb(0,0,255)
REM speed and acceleration
SPD# = 0
ACC# = 0.005
WACC# = 10
REM start loop
do
REM Movement Controls
move object 1, spd#
if keystate(57)= 1 then spd# = spd# + acc#
if keystate(57)= 0 then spd# = spd# - acc#
if keystate(2)= 1 then spd# = spd# + wacc#
if keystate(2)= 0 and spd# > 100 then spd# = spd# - wacc#
if keystate(2)= 0 and spd# < 0.25 then spd# = spd#
if keystate(3)= 1 then spd# = spd# - 100
if spd# < 0 then spd# = 0
REM Camera Positioning
PCSX# = OBJECT POSITION X(1)
PCSY# = OBJECT POSITION Y(1)
PCSZ# = OBJECT POSITION Z(1)
POSX#=wrapvalue(POSX#+mousemovex()*.5)
POSY#=wrapvalue(POSY#+mousemovey()*.5)
position camera PCSX#+(sin(POSX#)*sin(POSY#)*DIST#),PCSY#+(cos(POSY#)*DIST#),PCSZ#+(cos(POSX#)*sin(POSY#)*DIST#)
point camera PCSX#,PCSY#,PCSZ#
REM stops camera veiw from going upside down
if POSY# > 80 and POSY# < 180 then POSY# = 80
if POSY# > 180 and POSY# < 310 then POSY# = 310
if keystate(32)= 1 then RGT#=1+(KEYSTATE(32)*.5)
if keystate(32)= 0 then RGT#=0
if keystate(30)= 1 then LFT#=1+(KEYSTATE(30)*.5)
if keystate(30)= 0 then LFT#=0
if keystate(31)= 1 then PUP#=1+(KEYSTATE(31)*.5)
if keystate(31)= 0 then PUP#=0
if keystate(17)= 1 then PDN#=1+(KEYSTATE(17)*.5)
if keystate(17)= 0 then PDN#=0
if keystate(16)= 1 then RLT#=1+(KEYSTATE(16)*.5)
if keystate(16)= 0 then RLT#=0
if keystate(18)=1 then RRT#=1+(KEYSTATE(18)*.5)
if keystate(18)= 0 then RRT#=0
TURN OBJECT RIGHT 1,RGT#
TURN OBJECT LEFT 1,LFT#
PITCH OBJECT UP 1,PUP#
PITCH OBJECT DOWN 1,PDN#
ROLL OBJECT RIGHT 1,RRT#
ROLL OBJECT LEFT 1,RLT#
REM Camera Zoom
if mouseclick()=1 then dist# = dist# + 1
if mouseclick()=2 then dist# = dist# - 1
IF DIST# < 3 then DIST# = 3
IF DIST# > 360 then DIST# = 360
print "speed in meters per second: ", spd#*100print "this is actual spd# * 100"
SYNC
LOOP
end