Hi, I'm using DBClassic. I currently forming a game very similar in respects to cave-runner, but you fly inside the caves and shoot baddies in a third person craft (yeah, I know).
Collision techniques with the matrix walls of the cave have been disasterous. You see, the player is in control of his own y position - #y is not dependent upon the height of the matrix.
if rightkey()=1 and x# < 1200 and speedx#>-2.0 then speedx#=speedx#+1.0
if leftkey()=1 and x# > 1 and speedx#<2.0 then speedx#=speedx#-1.0
if upkey()=1 and y# < 30 and speedy#<2.0 then speedy# = speedy#+1.0
if downkey()=1 and y# > -30 and speedy#>-2.0 then speedy# = speedy#-1.0
if returnkey()=1 then speedz# = speedz#+1.0 else speedz#=speedz#-0.1
` further code manages these variables for smooth transition
` add the speeds to x#, y#, and z# accordingly
I've made two matrixes that scroll endlessly and have been randomized accordingly. They also are positioned to each other like sandwiched slices (like 60 units apart) with their sides pinched together. However, when I want to see how far the player is above the ground or below the ceiling of the matrixes I get obviously wrong answers. Heres my current (and wrong) way of getting those heights:
distance_floor = y#-(get ground height(1, x#, z#)-30)
distance_ceiling = y#-(get ground height(1, x#, z#)+30)
could someone please tell me the right way of doing this, please? I've been working on this problem for several weeks now.
"Power, precision, and don't forget about speed. If you practice everyday with these things in mind... you begin to develope A FIGHTING MODE." - Fist of Legend (Jet Li)