aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}
}