From 430d1af163a9a46ab27924caa164e15e95de64f1 Mon Sep 17 00:00:00 2001
From: Holden Rohrer
Date: Sat, 18 Jan 2020 15:26:12 -0500
Subject: realized that .once doesn't work for cursor
---
examples/jarvis.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'examples')
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);
}
}
--
cgit