slowing down a loop?

Blitz3D Forums/Blitz3D Programming/slowing down a loop?

You should NOT use delay in this situation or a loop. Something like this should work.

Set up a global VelocityY and const Gravity :

global VelocityY# = 0
const Gravity# = 1 


Only apply gravity if player has not collided with world :

if entitycollided( player, world_col ) 
     VelocityY# = 0
else
     VelocityY = VelocityY - Gravity
     if VelocityY < -100 VelocityY = -100
endif
translateentity player, 0 , VelocityY, 0