Added gamepad api for manual control

Esse commit está contido em:
Andrew Nesbitt
2013-10-02 23:33:52 +01:00
commit de0202a0f2
4 arquivos alterados com 270 adições e 2 exclusões
+9
Ver Arquivo
@@ -24,6 +24,15 @@ io.set('destroy upgrade', false)
io.sockets.on('connection', function(socket) {
console.log('connection')
socket.on('control', function(ev) {
console.log('[control]', JSON.stringify(ev));
if(ev.action == 'animate'){
client.animate(ev.animation, ev.duration)
} else {
client[ev.action].call(client, ev.speed);
}
})
socket.on('takeoff', function(data){
console.log('takeoff', data)
client.takeoff()