Community Curator/Source/TSWRes Functions

Math = {}

function Math.Bounce(Var, Top, Speed, Var2, Bottom) if not Bottom then Bottom = 0 end if Var2 == 0 then if Var >= Top then Var2 = 1 Var = Var - Speed else Var = Var + Speed end elseif Var2 == 1 then if Var <= Bottom then Var2 = 0 Var = Var + Speed else Var = Var - Speed end end return Var, Var2 end

return