Skip to content

Instantly share code, notes, and snippets.

@xErik
Last active June 10, 2021 14:12
Show Gist options
  • Save xErik/8037dcf5cfa4237f1126438bee770db6 to your computer and use it in GitHub Desktop.
Save xErik/8037dcf5cfa4237f1126438bee770db6 to your computer and use it in GitHub Desktop.
Game Level Calculation With Linearly Rising Level Gap
EXP LEVEL DIFF
0 1 0
10 2 10
30 3 20
60 4 30
100 5 40
150 6 50
210 7 60
280 8 70
360 9 80
450 10 90
diff = 10 * ( lvl - 1 )
xp = 10 * ( ( lvl - 1 ) * ( ( lvl - 1 ) + 1 ) ) / 2
lvl = = 1/2 + SQRT( 1/4 + 2 * xp/10 )
https://en.wikipedia.org/wiki/Triangular_number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment