diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/jarvis.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/jarvis.js b/examples/jarvis.js index f750903..7ea49b9 100644 --- a/examples/jarvis.js +++ b/examples/jarvis.js @@ -25,14 +25,14 @@ main.on('open', ()=>{ // Tries to identify itself with a cursor movement } }) +var sender; // Global variable that holds identity()'s `send` for tileHandler + function identity(send){ - sender = send; // Communicates local send to tileHandler as a global variable + sender = send; console.log('identity activated'); main.on('tileUpdate', tileHandler); } -var sender; - function tileHandler(send, source, tiles){ if (send == sender) return; let locs = tilekeys(tiles); |