I trying to create a points calculating system with javascript, but the problem is with the mathematical part. I have saved on the server the points number, and based on that number I want to decide the level. Sorry for my bad english, I cant explain very well :D. I want something like: level 1 need 0 points
level 2 needs 100 points
level 3 needs 240 points
level 4 needs 420 points
level 5 needs 640 points
and so on….
I need a mathematical function to calculate each level with it. Something that if I know the level to calculate the points needed, and if I know only the points to calculate the level.
I trying to create a points calculating system with javascript, but the problem is
Share
To generate the series you’ve provided use:
To get the level from the points is a bit more tricky, you need to invert the above formula using the quadratic formula and then take the positive solution:
Also, in the future try and make your questions clearer. As you can see three people (at least) misunderstood your question – it wasn’t clear that you set of levels was a mathematical series.