summaryrefslogtreecommitdiff
path: root/client/lib/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/lib/util.js')
-rw-r--r--client/lib/util.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/client/lib/util.js b/client/lib/util.js
index 48145e0..504c562 100644
--- a/client/lib/util.js
+++ b/client/lib/util.js
@@ -17,6 +17,7 @@ function mod(n,m){ return n-(m * Math.floor(n/m)) }
function randint(n){ return (Math.random()*n)|0 }
function randrange(a,b){ return a + Math.random() * (b-a) }
function randsign(){ return Math.random() >= 0.5 ? -1 : 1 }
+function lerp(n,a,b){ return (b-a)*n+a }
function requestAudioContext (fn) {
if (isMobile) {
@@ -62,7 +63,7 @@ function requestAudioContext (fn) {
}
export {
- choice, mod, clamp,
+ choice, mod, clamp, lerp,
randint, randrange, randsign,
browser, requestAudioContext,
}