Thanks for the Input!
ok if i do this...(using floats and check)
hide mouse
sync on
sync rate 60
center text screen width()/2,screen height()/2,"Loading..."
sync
load image "C:/Program Files/Dark Basic Software/Dark Basic Professional/Media/Textures/concrete_T.BMP",1
make matrix 1,1000,1000,100,100
prepare matrix texture 1,1,1,1
`make "colission box" for the FPS camera
player=1
make object box player,7,20,7
hide object player
position object player,10,5,10
global cameray#
global camerax#
global updateneeded
do
update_player(1)
sync
loop
rem Free-Flight Camera handling function
function Update_player(ID)
speed=3
length=20
updateneeded=0
if mousemovex()>0 or mousemovey()>0 or scancode()=17 or scancode()=30 or scancode()=31 or scancode()=32
updateneeded=1
endif
inc cameray#,mousemovex()
inc camerax#,mousemovey()
yrotate camera 0,cameray#
xrotate camera 0,camerax#
if scancode()=17 then move object id,1
if scancode()=31 then move object id,-1
if scancode()=30
oldx=object angle y(id)
newx=wrapvalue(oldx-90)
yrotate object id,newx
move object id,1
yrotate object id,oldx
endif
if scancode()=32
oldy=object angle y(id)
newy=wrapvalue(oldy+90)
yrotate object id,newy
move object id,1
yrotate object id,oldy
endif
posx=object position x(id)
posy=object position y(id)
posz=object position z(id)
yrotate object id,camera angle y()
position camera posx,posy+8,posz
endfunction
then the mouse doesn't work...
and if i do this...(floats and different check)
hide mouse
sync on
sync rate 60
center text screen width()/2,screen height()/2,"Loading..."
sync
load image "C:/Program Files/Dark Basic Software/Dark Basic Professional/Media/Textures/concrete_T.BMP",1
make matrix 1,1000,1000,100,100
prepare matrix texture 1,1,1,1
`make "colission box" for the FPS camera
player=1
make object box player,7,20,7
hide object player
position object player,10,5,10
global cameray#
global camerax#
global updateneeded
do
update_player(1)
sync
loop
rem Free-Flight Camera handling function
function Update_player(ID)
speed=3
length=20
updateneeded=0
if mousex()>0 or mousey()>0 or scancode()=17 or scancode()=30 or scancode()=31 or scancode()=32
updateneeded=1
endif
inc cameray#,mousemovex()
inc camerax#,mousemovey()
yrotate camera 0,cameray#
xrotate camera 0,camerax#
if scancode()=17 then move object id,1
if scancode()=31 then move object id,-1
if scancode()=30
oldx=object angle y(id)
newx=wrapvalue(oldx-90)
yrotate object id,newx
move object id,1
yrotate object id,oldx
endif
if scancode()=32
oldy=object angle y(id)
newy=wrapvalue(oldy+90)
yrotate object id,newy
move object id,1
yrotate object id,oldy
endif
posx=object position x(id)
posy=object position y(id)
posz=object position z(id)
yrotate object id,camera angle y()
position camera posx,posy+8,posz
endfunction
it runs but still "jitters"
if i do this...(floats and NO check)
hide mouse
sync on
sync rate 60
center text screen width()/2,screen height()/2,"Loading..."
sync
load image "C:/Program Files/Dark Basic Software/Dark Basic Professional/Media/Textures/concrete_T.BMP",1
make matrix 1,1000,1000,100,100
prepare matrix texture 1,1,1,1
`make "colission box" for the FPS camera
player=1
make object box player,7,20,7
hide object player
position object player,10,5,10
global cameray#
global camerax#
do
update_player(1)
sync
loop
rem Free-Flight Camera handling function
function Update_player(ID)
speed=3
length=20
inc cameray#,mousemovex()
inc camerax#,mousemovey()
yrotate camera 0,cameray#
xrotate camera 0,camerax#
if scancode()=17 then move object id,1
if scancode()=31 then move object id,-1
if scancode()=30
oldx=object angle y(id)
newx=wrapvalue(oldx-90)
yrotate object id,newx
move object id,1
yrotate object id,oldx
endif
if scancode()=32
oldy=object angle y(id)
newy=wrapvalue(oldy+90)
yrotate object id,newy
move object id,1
yrotate object id,oldy
endif
posx=object position x(id)
posy=object position y(id)
posz=object position z(id)
yrotate object id,camera angle y()
position camera posx,posy+8,posz
endfunction
it does the same as the last one
so it seems that i need either a) a better way to check for the mouse moving... or B) something else
Formerly known as "DarkWing Duck"