Javascript points calculating system
- by coolboycsaba
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.