need help with darkbasic


#1

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


#2

if camera angle x()>90 and camera angle x()<180 then xrotate camera 90
if camera angle x()<270 and camera angle x()>180 then xrotate camera 270

I hope that would work… If these lines just created bugs, i’m an idiot…
Try visiting the forum of www.thegamecreators.com. Many people will help you there…


#3

actually it didn’t work, but it didn’t create bugs eather, infact, it had no effect whatsoever??
thanks for trying though.


#4

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.