Gravity

Blitz3D Forums/Blitz3D Beginners Area/Gravity

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Unless you want your avitar to rocket to the earth faster than a bullet from a gun I suggest having either a constant timestep variable or use some sort of deltatiming method.

This is just contant ..

Const Gravity# = -9.8
const TimeStep# = .05

;each loop
If ObjectY is not on ground, then
ObjectYSpeed# = ObjectYSpeed# + Gravity * ( TimeStep * TimeStep )
ObjectY# = ObjectY# + ObjectSpeed * ( Timestep )


Stevie