summaryrefslogtreecommitdiff
path: root/client/index.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-07-06 04:12:00 +0200
committerJules Laplace <julescarbon@gmail.com>2017-07-06 04:12:00 +0200
commit88ca0a65e003bb1706d5139fe057a082c150fa56 (patch)
treef68421f4c6183014eae93f4a860fa25d49a7541f /client/index.js
parentdbc7ea7883ece2f5e5d320a0e886028cfd5cdac9 (diff)
more clickyHEADmaster
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 44984a7..56337cc 100644
--- a/client/index.js
+++ b/client/index.js
@@ -74,6 +74,7 @@ document.body.appendChild(canvas)
let count = 0
function down (e) {
drawing = true
+ intensity = Math.min(0.999, intensity + 0.08)
mouse.x = e.pageX / window.innerWidth
mouse.y = e.pageY / window.innerHeight
}
@@ -84,7 +85,7 @@ function move (e){
const dy = (mouse.y - y)
const v = Math.sqrt(dx*dx+dy*dy)
if (drawing) {
- intensity = Math.min(0.999, intensity + v*0.1)
+ intensity = Math.min(0.999, intensity + v*0.1 + 0.02)
inertialIntensity = Math.min(0.999, intensity)
if (intensity == 0.999) intensity -= (Math.random() * 0.4)
if (inertialIntensity == 0.999) inertialIntensity -= (Math.random() * 0.3)