I have a code that I made with an fps camera and a matrix terrain. The
camera is set at ground level.What i want to do is instead of it being
locked in ground level is to be able to fly around the map with the camera. Is this a gravity problem or a control problem that i need to change in order to do this? Also could someone mabey post a change to my code that makes it so I can do this? Here is my code
load image "grass.jpg",1
prepare matrix texture 1,1,2,2
rem Set variables for character position
cx#=2500
cz#=2500
speed#=3.0
rem Activate manual sync
sync on : sync rate 60
hide mouse
rem Begin loop
do
set cursor 0,0
print "mcy#=",mcy#
print "mcx#=",mcx#
print "Camera Angle Y=",camera angle y()
rem Use MOUSEMOVE to alter camera angles
mcx#=wrapvalue(mcx#+mousemovey()*.5)
mcy#=wrapvalue(mcy#+mousemovex()*.5)
rotate camera mcx#,mcy#,0
rem Use WASD controls
if inkey$() = "w" then move camera 10
if inkey$() = "s" then move camera -10
if inkey$() = "a" then yrotate camera wrapvalue(camera angle y()-90) : move camera 10 : yrotate camera wrapvalue(camera angle y()+90)
if inkey$() = "d" then yrotate camera wrapvalue(camera angle y()+90) : move camera 10 : yrotate camera wrapvalue(camera angle y()-90)
rem Position camera to the ground height
cy#=get ground height(1,camera position x(),camera position z())+100.0
position camera camera position x(),cy#,camera position z()
rem Syncronise
sync
rem End loop
loop
gm07