-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnumbers.js
37 lines (31 loc) · 965 Bytes
/
numbers.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//var conn = (window.controller = new Leap.Controller({background: true}))
// .use('riggedHand', {
// positionScale: 0.5,
// background: true
// });
var controllerOptions = {enableGestures: true,
background: true,
loopWhileDisconnected: false};
window.connectNumber = function () {
conn.connect();
}
window.disconnectNumber = function () {
if(!!window.conn) window.conn.disconnect();
}
var iter = 0;
var operaciones = ["2 + 3 = __",
"4 - 2 = __",
"__ * 7 = 21",
"4 * __ = 20",
"3 - 1 = __"];
var respuestas = [5, 2, 3, 5, 2 ];
var operacionesDOM = document.getElementById('operaciones');
operacionesDOM.innerHTML = operaciones[iter];
function countFingers(hand) {
if(!hand || !window.numberActive) return 0;
var count = 0;
hand.fingers.forEach(function( finger) {
if(finger.extended) count ++;
});
return count;
}