Happy Hands is a client side javascript library which helps you detect physical gestures coming from a mobile device.
script(src = '/HappyHands.js')
punch = [[20, 50, 15, 9, 3, 6, 80, 5 ,1], [20, 50, 15, 9, 3, 6, 80, 5 ,1]]
kick = [[20, 50, 15, 9, 3, 6, 80, 5 ,1], [20, 50, 15, 9, 3, 6, 80, 5 ,1]]
slap = [[20, 50, 15, 9, 3, 6, 80, 5 ,1], [20, 50, 15, 9, 3, 6, 80, 5 ,1]]
hands = new HappyHands(
accuracy : 5
poll_speed : 3
)
hands.on punch, ->
alert 'FACE PUNCH'
hands.on slap, ->
alert 'KICK'
hands.on punch, ->
hands.on slap, ->
alert 'PUNCH SLAP'
hands.on punch, (->
alert 'PUNCH'
),
kill_on_complete : true
accuracy : 10
Records can be created from going to the happy hands web site and recording a gesture.
coffee -c -w -o lib/ src/
mocha --compilers coffee:coffee-script -R spec