Gravity woes

Blitz3D Forums/Blitz3D Beginners Area/Gravity woes

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.

I am extremly confused by your code. try this:

const gravity#=-.2

;Collisions
Const TYPE_PLAYER=1,TYPE_CAMERA=2,TYPE_SCENERY=3
; Player-to-scenery
Collisions TYPE_PLAYER,TYPE_SCENERY,2,3

hero\y_vel#=hero\y_vel#+gravity#
hero\y=hero\y+hero\y_vel
translateentity hero\entity,0,hero\y_vel,0

note: this might be wrong as I did it in the browser :-/ also, it assumes that you have a y_vel field in type hero.