This commit is contained in:
AJ Kelly
2010-07-11 00:28:39 -05:00
parent 0c02d883d1
commit a82ee268e0
+10 -3
View File
@@ -70,15 +70,15 @@ function fapproach( val, other_val, to_move )
if val == other_val then
return val -- already done!
end
local delta = other_val - val
local sign = delta / math.abs(delta)
local toMove = sign*to_move
if math.abs(toMove) > math.abs(delta) then
toMove = delta -- snap
end
val = val + toMove
return val
end
@@ -99,6 +99,13 @@ function tableslice( t, num )
return ret
end
function round(val, decimal)
if (decimal) then
return math.floor( (val * 10^decimal) + 0.5) / (10^decimal)
else
return math.floor(val+0.5)
end
end
function GetRandomSongBackground()
for i=0,50 do