summaryrefslogtreecommitdiff
path: root/client/index.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-02-21 14:55:24 +0100
committerJules Laplace <julescarbon@gmail.com>2018-02-21 14:55:24 +0100
commit30c73e04f6d60955f68ef0e93176a6ebc24ef40f (patch)
tree1430e2f60cbca76a4f3af45ca2b02fdffe1009a5 /client/index.js
parentc31108b27156d2d1f2c50b57179828da9725f615 (diff)
mobile check
Diffstat (limited to 'client/index.js')
-rw-r--r--client/index.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/client/index.js b/client/index.js
index 0b5f16b..04b7f17 100644
--- a/client/index.js
+++ b/client/index.js
@@ -10,6 +10,7 @@ import mouse from './lib/mouse'
import {
browser, requestAudioContext,
randint, randrange, clamp,
+ isMobile,
} from './lib/util'
const root = 440
@@ -62,7 +63,7 @@ mouse.register({
draw.triangle(x, y, 400)
},
move: (x, y, dx, dy) => {
- let count = Math.abs(dx + dy) / 40
+ let count = Math.abs(dx + dy) / (isMobile ? 5 : 40)
if (count < 1) return
count = clamp(count, 1, 10)
if (Math.abs(dx) + Math.abs(dy) > 100) {