i was working on a way to get a truck from a to be
by using the mouse but when i set the display mode the positioning gos wrong how can i fix this
` see line 17 and change so it will run
`rts V0.02
`setup
`set display mode 640,680,32 :` ****** bug **** the mouse y position gos wrong in 3D mode (z is the 2D y)
sync on :sync rate 60
global info_timer =0 :` how to play infor at the top
`make ground
make matrix 1,600,400,12,12
`add a tanker
load object "tanker.x",99 :`change for a cube as you do not have the tanker
scale object 99,300,300,300
yrotate object 99,180
fix object pivot 99
tanker =99
`make 3d mouse for positioning the goto point
make object cube 1,12 :` 3d mouse
hide object 1
do
if spacekey()=1
mouse_3d =1
else
mouse_3d =0
endif
if mouse_3d =1
mouse_fix= -mousey()
position object 1,mousex()-15,6,mouse_fix +440
if mouseclick()=1 :` make a go to point ( 2 is the point / 1 is the 3d mouse)
if object exist(2)=1
delete object 2
endif
make object sphere 2,12
position object 2, object position x(1) ,object position y(1) ,object position z(1)
endif
endif
`tanker logic
if object exist(2) =1
point object tanker ,object position x(2) ,object position y(2) ,object position z(2)
move object tanker,1.5
if object collision (tanker,2)=1
delete object 2
endif
endif
if escapekey()=1
end
endif
display_info()
position camera 300,400,200 : xrotate camera 90 :`bug fixed camera (do not re-move)
sync
loop
end
function display_info()
info_timer = info_timer +1
if info_timer=< 200
tex$ = "push space to use the mouse in 3d space"
endif
if info_timer=> 200
tex$ = "left click the mouse to set a goto path (3d space mode only)"
endif
if info_timer=> 400
tex$ = "push escape key to end"
endif
if info_timer=> 600
info_timer =0
endif
set cursor 5,5
print tex$
endfunction
flame