Looks Cool
AHH - I know ......
Try this!
Adding to X,Y,Z is only good SOMETIMES. Once you turn the object ,
its not correct - because the Grid you did math on DID not turn.
By moving the camera versus trying to calc the correct x,y,z pos for the camera - I CHEAT - Let DBPro do the work
See how I Moved the camera versus trying to "Offset it" with Plus 4 on X axis, +y on Y axis?
That should do it.
rem A Malice Games Production
` You'll HAVE to test this - I tweaked - but no compiler here :(
` Also read up on Sync Command. Plus I TRIED to get your fog working how
` you wanted but by not putting it loop. (Unnessary commands being executed over
` and over slow down your programs when they get bigger. When they are bigger
` - it can cost ya!
Sync On ` tells system YOU will tell it when to draw, not up to puter ;)
load object "coronatug.x",1
health#=100
money#=0
speed#=0
color backdrop rgb(0,0,0)
hide mouse
menu_state#=0
disable escapekey
make object sphere 2,200
position object 2,200,100,-20
make object sphere 3,200
position object 3,600,900,30
do
text 1,1,str$(screen fps())
`---YOUR CAMERA CODE
`position camera object position x(1),object position y(1)+4,object position z(1) `the +5 is how high up you want the camera
`set camera to object orientation 1
`move camera -15 `this is how far behind the object you want the camera
`---YOUR CAMERA CODE
if upkey()=1 then pitch object up 1,1
if downkey()=1 then pitch object down 1,1
if leftkey()=1 then turn object left 1,1
if rightkey()=1 then turn object right 1,1
if keystate(1)=1 then Gosub menu
if keystate(51)=1 then dec speed#,.01
if speed#<0 then speed#=0
if keystate(52)=1 then inc speed#,.01
if speed#>1.5 then speed#=1.5
text 1,11,"Speed:"+str$(speed#)
move object 1,speed#
`---YOUR CAMERA CODE MOVED
X#=object position x(1)
Y#=object position y(1)
Z#=object position z(1)
Position Camera X#, Y#, Z#
set camera to object orientation 1
move camera -15
pitch camera up 90
move camera 4
pitch camera down 90
`position camera object position x(1),object position y(1)+4,object position z(1) `the +5 is how high up you want the camera
`set camera to object orientation 1
`move camera -15 `this is how far behind the object you want the camera
`---YOUR CAMERA CODE MOVED
sync ` makes screen redraw because you told it too - not cuz it feels like it
loop
`--------------
menu:
`--------------
fog on
fog color rgb(0,0,0)
fog distance 1
do
text 1,1,"Cmk's menu system"
if menu_state# > 2 then dec menu_state#,1
if menu_state# < 0 then inc menu_state#,1
if menu_state# = 0 then text 500,400,"Resume"
if menu_state# = 1 then text 500,400,"Quit"
if menu_state# = 2 then text 500,400,"View Variables"
if leftkey()=1 then wait 200:dec menu_state#,1
if rightkey()=1 then wait 200:inc menu_state#,1
if returnkey()=1 then if menu_state#=1 then end
if returnkey()=1 then
if menu_state#=0 then
fog off
return
endif
if returnkey()=1 then if menu_state#=2 then gosub menu_info
sync ` makes screen redraw because you told it too - not cuz it feels like it
loop
`--------------
`--------------
menu_info:
`--------------
do
text 1,1,"Age Of Discovery"
text 450,400,"Health:"+str$(health#)
text 450,422,"Credits:"+str$(money#)
text 450,433,"Press Spacebar to return"
if spacekey()=1 then return
sync ` makes screen redraw because you told it too - not cuz it feels like it
loop
`--------------