Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function easeGameSpeed(value)
- local count = 1
- local currentSpeed = math.round(getGameSpeed(), 1, "floor")
- local steps = 0.1
- if not (value > currentSpeed) then
- steps = -0.1
- end
- for i = currentSpeed, value, steps do
- setTimer(setGameSpeed, 150 * count, 1, i)
- count = count + 1
- end
- end
- function math.round(number, decimals, method)
- decimals = decimals or 0
- local factor = 10 ^ decimals
- if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor
- else return tonumber(("%."..decimals.."f"):format(number)) end
- end
Advertisement
Add Comment
Please, Sign In to add comment