Okay, that was a tricky one, but I think I have gotten it ironed out. Check this out:
sync on : sync rate 60
make object box 2,5000,10,5000
maxcubes = 100
color object 2,rgb(0,225,0)
position object 2,0,-5,0
make object cube 1,10
position object 1,0,5,0
position camera 0,5,-220
point camera 0,0,0
repeat
if UPKEY() then x# = camera angle x() : x# = x# - cos(x#) : xrotate camera x#
if DOWNKEY() then x# = camera angle x() : x# = x# + cos(x#) : xrotate camera x#
if keystate(32) = 1
y# = camera angle y()
cx# =camera angle x()
cz# = camera angle z()
y# = wrapvalue(y# + 90)
rotate camera 0,y#,0
move camera 1
y# = wrapvalue(y# - 90)
rotate camera cx#,y#,cz#
endif
if keystate(30) = 1
y# = camera angle y()
cx# = camera angle x()
cz# = camera angle z()
y# = wrapvalue(y# - 90)
rotate camera 0,y#,0
move camera 1
y# = wrapvalue(y# + 90)
rotate camera cx#,y#,cz#
endif
Rem - Make right joystick rotate screen left and right.
if RIGHTKEY()
y# = camera angle y()
y# = wrapvalue(y# + 1.0)
yrotate camera y#
endif
if LEFTKEY()
y# = camera angle y()
y# = wrapvalue(y# - 1.0)
yrotate camera y#
endif
if keystate(17) = 1
cay# = camera angle y()
cx# =camera position x()
cy# = camera position y()
cz# = camera position z()
nx# = newxvalue(cx#,cay#,1)
nz# = newzvalue(cz#,cay#,1)
position camera nx#,cy#,nz#
endif
if keystate(31) = 1
cay# = camera angle y()
cx# =camera position x()
cy# = camera position y()
cz# = camera position z()
nx# = newxvalue(cx#,cay#,-1)
nz# = newzvalue(cz#,cay#,-1)
position camera nx#,cy#,nz#
endif
sync
until spacekey() = 1
for i = 1 to 2
delete object i
next i
end
LB
So many games to code.......so little time.