Look at other games and see how they calculate their max required exp, along with deciding how much exp you gain from a certain task.
PHP Code:
function addExp(exp) {
clientr.stat.exp += exp;
if (clientr.stat.exp >= expRequired(clientr.stat.level)) {
levelUp();
}
}
function expRequired(lvl) {
temp.amount = lvl ^ 3;
return temp.amount;
}
function levelUp() {
clientr.stat.level++;
clientr.stat.exp = 0;
}
|
Ah, alrighty thanks. Would I be placing this in a class, or a weapon then?
Makes sense how it works, thanks!