Every object I want to be affected by gravity has a velocity type in it. You needn't do it like this, but I actually can't imagine doing it any other way
...
define your types ...
type TVec
x# as float
y# as float
z# as float
endtype
type TPlayer
velocity as TVec
position as TVec
object_id as integer
endtype
and affect the velocity in your main loop...
function handlePlayerMovement()
dec player.velocity.y#, _gravity# `-- set this variable somewhere
inc player.position.x#, player.velocity.x#
inc player.position.y#, player.velocity.y#
inc player.position.z#, player.velocity.z#
position object player.object_id, player.position.x#,player.position.y#,player.position.z#
Basically, the idea here is to create an increasingly negative value, and change your player's height by that amount. Because you're decrementing your y velocity by a constant every time, you get a very simple, but effective downward vertical acceleration effect...
ta da.
Can I ask you a Question?
What is it?
It's an interrogative form of sentence, used to test knowledge. But that's not important right now.