how can i make a levelup system that easy to code like i wont have to PHP: if(players level equals 1){set level up cost(22)}if(players level equals 2){set level up cost (44)} i could just make it add 22 per levelup
Both — a linear and exponential levelling system are easy to code. You specified you wanted to add 22 xp per level, which is a linear levelling system. Growth chart of linear vs exponential: Red = Linear Blue = Exponential Green = Exponential Code: levelup_cost = 22 * x //x = xp level While that code is only applicable for levels 1 to infinity, if you are starting from level 0, you could simply add a +1 to the level. Code: levelup_cost = 22 * (x + 1) If you want to go with an exponential growth, you could try: Code: levelup_cost = x ** 2 //Or 2 ** x (NOTE: they're not the same, see the graph) //2 is the growth factor //The bigger the growth factor, the larger is the levelup_cost Both seem simple, preferences?