elevator lanterns

This commit is contained in:
2024-04-07 12:07:16 -04:00
parent 05e3b9406f
commit 42db037fc5
12 changed files with 399 additions and 189 deletions

View File

@@ -7,34 +7,34 @@
type EaseFunction = (n: number) -> number
type LinearFunction = (a: number, b: number, t: number) -> number
export type EasingStyles = {
export type Math = {
Linear: LinearFunction,
InOutBack: EaseFunction,
OutBounce: EaseFunction,
InQuad: EaseFunction
InQuad: EaseFunction,
}
local Ease = {} :: EasingStyles
local Math = {} :: Math
--Google straight up gives wrong/bad math
function Ease.Linear(a,b,t)
function Math.Linear(a,b,t)
return a-a*t+b*t
end
local c = 2.59491
function Ease.InOutBack(n)
function Math.InOutBack(n)
return n<.5 and 2*n*n*(-c+2*n+2*c*n) or 3*(-1+n)*(-1+n)*(-2-c+2*n+2*c*n)
end
local n1, d1 = 7.5625, 2.75
function Ease.OutBounce(n)
function Math.OutBounce(n)
return (n<0.363636 and n*n*n1 or
n<0.727273 and (.75*(1.*d1-2.*n*n1)) or
n<0.909091 and (.9375*(1.*d1-2.4*n*n1)/d1)) or (.984375*(1.*d1-2.66667*n*n1))/d1
end
function Ease.InQuad(n)
function Math.InQuad(n)
return n*n
end
return Ease
return Math

View File

@@ -43,7 +43,7 @@ function Tags.constructor()
end
function Tags:Request(Name)
return self.__export[Name] or error(`Error requesting tag name, tag name "{Name}" does not exist`, 2)
return self.__export[Name] or error(`Error requesting tag name, tag name "{Name}" does not exist.`, 2)
end
function Tags:Nuke()