Gravity is just a vertical force, every time you move the object (a ship, right?) just subtract a constant (const GRAVITY = 9) from the Y position of the object.

And if its also thrusting during that iteration, add whatever constant thrust should be, 10 or more if you want it to beat gravity and 9 if it shouldn't move, vertically, and less than 9 if you want it to fall slower. (play with all those numbers to see what works best for your game)

That was entirly too long winded for the simplicity of this answer.

Just because it doesn't follow the phsyics of this world doesn't mean it does work just as well.

NOMAD