I`m not using DBpro...
And I still Have my movements (roll effect) problem.
Here`s the situation. I first did my movements code using this:
If keystate(79)=1
camposX#=Newxvalue(camposX#,Wrapvalue(CY#-90),1)
camposZ#=Newzvalue(camposZ#,Wrapvalue(CY#-90),1)
Position Camera camposX#,camposY#,camposZ#
Endif
If keystate(81)=1
camposX#=Newxvalue(camposX#,Wrapvalue(CY#+90),1)
camposZ#=Newzvalue(camposZ#,Wrapvalue(CY#+90),1)
Position Camera camposX#,camposY#,camposZ#
Endif
if leftkey()=1 then turns#=turns#-0.1
if rightkey()=1 then turns#=turns#+0.1
turns#=turns#/1.05
yrotate camera wrapvalue(cy#+turns#)
if upkey()=1 then pitch#=pitch#+0.1
if downkey()=1 then pitch#=pitch#-0.1
pitch#=pitch#/1.05
xrotate camera wrapvalue(cx#+pitch#)
if keystate(73)=1 then roll camera right 10
if keystate(71)=1 then roll camera left 10
In this situation, I got left-right + up-down movement with a smooth effect. I also have the straf movement. but with this kind of code logic, I can`t do the roll effect (I also tried with FROGGIE! suggestion).
So I tried with something else. I saw in the code section here, and in the dark basic example, the free flight but only by moving an object in front of the camera and then moving the camera. so I create an hidden object and then move this object. By doing this, I got all the movement I wants, but...I can`t get the smooth (acceleration) effect...
here`s the code
`hidden object
make object sphere 2,10
position object 2,500,10,500
`drone for camera
make object sphere 3,10
do
if keystate(79)=1 then roll object left 2, 2
if keystate(81)=1 then roll object right 2, 2
if downkey()=1 then pitch object up 2, 2
if upkey()=1 then pitch object down 2, 2
if rightkey()=1 then turn object right 2, 2
if leftkey()=1 then turn object left 2, 2
if keystate(201)=1 then position object 2,camposx#,camposy#+1,camposz#
if keystate(209)=1 then position object 2,camposx#,camposy#-1,camposz#
If keystate(71)=1
camposX#=Newxvalue(camposX#,Wrapvalue(CY#-90),1)
camposZ#=Newzvalue(camposZ#,Wrapvalue(CY#-90),1)
Position object 2,camposX#,camposY#,camposZ#
Endif
If keystate(73)=1
camposX#=Newxvalue(camposX#,Wrapvalue(CY#+90),1)
camposZ#=Newzvalue(camposZ#,Wrapvalue(CY#+90),1)
Position object 2,camposX#,camposY#,camposZ#
Endif
move object 2, speed#
pitch object down 2,11
position object 3, object position x(2),object position y(2),object position z(2)
pitch object up 2,11
position camera object position x(3),object position y(3), object position z(3)
set camera to object orientation 2
endif
Sync
LOOP
Finaly, my questions:
I will like to know from someone with more experience if it`s ok to use the hidden object to do a first person view game(space sim)?
Also how to improve the codes to add the smooth effect?
Thanks