hi.. i am very new to dbp and i am attempting to write a 3d game. however i have come upon some troubles with player movement. here is the code i have written it may be messy because it is my first.
sync on
sync rate 30
make matrix 1,500,500,100,100
fog on
Fog distance 900
fog color rgb(10,10,10)
backdrop on
Color Backdrop RGB(10,10,70)
Set camera range 1,2000
load object "zangetsu.x",5
position object 5,50,14,50
xrotate object 5,270
do
AngleY# = object angle Y(5)
if upkey()=1 then move object 5,10
XTest# = Newxvalue(X#,AngleY#,20)
ZTest# = Newzvalue(Z#,AngleY#,20)
If XTest#>0 and XTest#<10000 and ZTest#>0 and ZTest#<10000
endif
If leftkey()=1 then Yrotate object 5,Wrapvalue(AngleY#-5)
If Rightkey()=1 then Yrotate object 5,Wrapvalue(AngleY#+5)
X# = Object position x(5)
Z# = Object position z(5)
Y# = Get Ground Height(1,X#,Z#)
yAng#=object angle y(5)
Position object 5,X#,Y#+12.5,Z#
CameraZ# = Newzvalue(Z#,AngleY#-180,90)
CameraX# = Newxvalue(X#,AngleY#-180,90)
CameraY# = Get Ground Height(1,CameraX#,CameraZ#)
Position camera CameraX#,CameraY#+20,CameraZ#
Point camera X#,Y#+20,Z#
move camera z#+10
sync
loop
i can get left\right rotate to work but forward\ back, i think it has something to do with the xrotate object not sure
sorry in advance if this question has been asked but i couldnt find it on the forum