I am trying to make the system for point receival formula. The max time(On most levels) is 999 seconds.(Meaning you have to finish that level before 999 seconds.) The smallest is one second, obviously. The max points you can get from a level is 100. I need a formula that will set the points received accordingly. 1 - the max time to get 100 points being 100, 999 - the max time to get 1 point being 1.
mob/proc
Get_Points(mob/M, time, max_small_time, max_large_time)
M = src
That is all I have so far. I think the max_small_time and the max_large_time are pretty self-explanatory, due to my last sentence before.
Any help is appreciated.(And if you want to help make the game, post in my thread at BYOND Casual!)
I am also kind of a dummy when it comes to HUDs. I know the basics, but can someone explain to me how I would make a counting HUD? Like, it counts from 1-999, like the game Feval?(Sorta)
So if you finish in 1 second you get 100 points, if you finish in 999 you get 1 point, and you want all other points to be evenly, linearly distributed between?
You could just do points = round((1000-time)/10)+1.
1000-time will give you a range from 1 to 999 where 1 means you took the longest time, and 999 means you did it fastest (1 second). Then divide by 10 and round down to the nearest integer, and you have a point range from round(1/10)=0 to round(999/10)=99, then the +1 changes it from 0-99 to 1-100.
(edit)fixed the missing parenthesis in the formula(/edit)