diff --git a/constants.h b/constants.h index 77828c7..a3af8c1 100644 --- a/constants.h +++ b/constants.h @@ -267,7 +267,12 @@ #endif #define SFG_PLAYER_JUMP_OFFSET_PER_FRAME \ - ((SFG_PLAYER_JUMP_SPEED * RCL_UNITS_PER_SQUARE) / SFG_FPS) + (((SFG_PLAYER_JUMP_SPEED * RCL_UNITS_PER_SQUARE) / SFG_FPS) \ + - SFG_GRAVITY_SPEED_INCREASE_PER_FRAME / 2) + /* ^ This substraction corrects the initial veloc. so that the numeric curve + copies the analytical (smooth) curve. Without it the numeric curve goes + ABOVE and makes player jump higher with lower FPS. To make sense of this + try to solve the differential equation and plot it. */ #if SFG_PLAYER_JUMP_OFFSET_PER_FRAME == 0 #define SFG_PLAYER_JUMP_OFFSET_PER_FRAME 1