Maxmin and IsEven, work on getting doors functional again

This commit is contained in:
2024-04-28 02:21:34 -04:00
parent d77778ed7d
commit ff8f3e4915
4 changed files with 19 additions and 12 deletions

View File

@@ -27,6 +27,7 @@ export type Math = {
InOutBack: EaseFunction,
OutBounce: EaseFunction,
InQuad: EaseFunction,
IsOdd: (n: number) -> boolean,
IsEven: (n: number) -> boolean,
RotationMatrix: (X: number, Y: number, Z: number) -> RotationMatrix,
Scalar: (X1: number, Y1: number, X2: number, Y2: number) -> Scalar,
@@ -36,10 +37,14 @@ export type Math = {
local Math = {} :: Math
function Math.IsEven(n)
function Math.IsOdd(n)
return bit32.btest(bit32.band(n, 1))
end
function Math.IsEven(n)
return not Math.IsOdd(n)
end
function Math.maxmin(min, n, max)
return math.max(min, math.min(n, max))
end