So I have a members website written in PHP and MYSQL.
Say for a second I want to let my users level up as a reward system and they get XP from doing certain things on the site like posting and what not. Giving the XP is the easy bit, the bit I am kinda stuck on is how the levelling will actually work.
When someone joins it will auto be at lv 1. Now say it lv x 2 for XP to level up per time;
lv1 = 2 xp
lv2 = 4 xp
lv3 = 6xp
lv4 = 8xp
How do I factor this into a formula, so when the XP is reached it will for the certain LV it will level the user up and double the amount of XP needed?
formulas:
your sample:
Double required xp after each level
EDIT:
Where $xpForNextLevel is the total amount of xp required to reach the next level, NOT the difference betwean this level and the next.