aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorHolden Rohrer <hr@hrhr.dev>2020-01-18 15:26:12 -0500
committerHolden Rohrer <hr@hrhr.dev>2020-01-18 15:26:12 -0500
commit430d1af163a9a46ab27924caa164e15e95de64f1 (patch)
treed0baf6f77a471bc920a7ca111a2a04bc02021a00 /examples
parentc05dcec7ecddca7d1389e12b8132b07f81d975e8 (diff)
realized that .once doesn't work for cursor
Diffstat (limited to 'examples')
-rw-r--r--examples/jarvis.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/jarvis.js b/examples/jarvis.js
index aa400e1..2dee842 100644
--- a/examples/jarvis.js
+++ b/examples/jarvis.js
@@ -42,12 +42,13 @@ function open(){
console.log('socket opened');
let coords = [Math.floor(Math.random()*100000+16),Math.floor(Math.random()*100000+16)];
main.cursor(coords);
- main.once('cursor', detect);
+ main.on('cursor', detect);
function detect(pos, send){
if (vec.equals(pos[0],coords)){
main.off('cursor', detect);
identity(send);
}
+ main.off('cursor', detect);
}
}