i am currently using a programming language called darkbasic to write a game about my friend’s movie, however i ran into some trouble with the controls.
my problem is that i can’t figure out how to make the camera stop rotating up or down when it gets at too high of an angle causing it to flip around backwards and move in the opposite direction upside down can someone help me.
here is what i have so far.
hide mouse
make matrix 1,30000,30000,50,50
position matrix 1,0,0,0
load bitmap “textures\beachsand final2.bmp”,1
get image 1,0,0,256,256
delete bitmap 1
prepare matrix texture 1,1,2,2
randomize matrix 1,300000.0
set camera range 1,15000
fog on
fog color 1
fog distance 15000
set point light 0,15000,get ground height(1,15000,15000),15000
position camera 15000,0,15000
sync on
load bitmap “textures/sky.bmp”,2
get image 2,0,0,320,240
texture backdrop 2
backdrop on
ramt1=2.7
ramt2=2.7
ramt3=4
ramt4=4
do
camposx=camera position x()
camposy=camera position y()
camposz=camera position z()
posY=get ground height(1,camposx,camposz)
if camera position y()=posY
position camera camposx,camposy,camposz
else
position camera camposx,posY+200,camposz
endif
if upkey()=1
move camera (x+10.0)
endif
if downkey()=1
move camera (x-10.0)
endif
if mousemovey()>0 then anglex#=wrapvalue(anglex#+ramt1)
if mousemovey()<0 then anglex#=wrapvalue(anglex#-ramt2)
if mousemovex()>0 then angley#=wrapvalue(angley#+ramt3)
if mousemovex()<0 then angley#=wrapvalue(angley#-ramt4)
xrotate camera anglex#
yrotate camera angley#
zrotate camera 0.0
sync
loop