I have the following function:
function getLevel(points)
{
var level = -1 + Math.sqrt(4 + points/20);
// Round down to nearest level
return Math.floor(level);
}
The above function calculates the level of a player based on their points, my problem is that I need a function like this to calculate the points needed for a given level.