if the object is in mid-air, i'll make the person fall faster and faster (until the average speed where wind friction would stop a person).. and once on the ground, the velocity downward will go back to normal
so, i need to know when the player object is in midair. i'm using NGC. i'm pretty sure the best way is to use this command
rem Get number of collisions for object
collCount = CountCollisionsPRO( yourObject )
rem goes through each collision
for t=1 to collCount
rem Gets the normal of contact for this collision
normY# = CollisionHitNormY( yourObject, t )
next t
(that is straight from help file, with unneeded lines deleted)
so normy#, when in midair, is zero, when on flat ground its 1, when on a slope its in between. so i can say, if normy# is less than 1, increase velocity downward, so you slide down ramps faster and faster, and fall faster and faster, like real gravity.
however... there is often more than one ynormal collision. for each wall you are touching, there is a ynorm# at 0. how can i get the ynorm# just for the ground?
ok i think i got the answer. go through the ynorm#s, and if any one of them is > 0.999, set gravity back to normal... else, accelerate person downward
i'm still going to post this incase it doesnt work, or incase someone else has a simpler/faster method of accelerated falling that they can share
edit: yes it does work. here is your function, if anyone wants it
REM fall
found=checkmidair()
if found=1
print "you are on the ground"
else
print "you are in mid air"
endif
function checkmidair()
REM find out if player is in midair or on ground
collCount = CountCollisionsPRO( cam_obj )
found=0
for t=1 to collCount ` go through each collision
normY# = CollisionHitNormY( cam_obj, t )
if normY#>0.999 then found=1
next t
endfunction found