13.05.2017, 06:52
Just divide the distance by 1000 and round it down to an integer value. That will give the number of cookies earned.
If you want to reward the players while they are working, you must keep track of how many cookies they got so far. Once the amount from the calculation above is different from the stored value, give another cookie and update the variable.
Код:
new cookies = floatround(distance / 1000.0, floatround_floor);