photonstorm/phaser — pull request #411 by acron0 (2014-02-13 15:56:26+00:00)
Title: Added Gestures; support for four initial gestures at the canvas level

Not sure who else is interested in this, but I've added some boilerplate for detecting generic gestures at the canvas level, starting with SwipeLeft, SwipeRight, SwipeUp, SwipeDown. Very similar to Hammer.js but still primitive and 'Phaser'-ized.

game.input.gestures.add(Phaser.Gestures.SwipeLeft, function() { console.log("Swiped left"); });
game.input.gestures.add(Phaser.Gestures.SwipeRight, function() { console.log("Swiped right"); });
game.input.gestures.add(Phaser.Gestures.SwipeUp, function() { console.log("Swiped up"); });
game.input.gestures.add(Phaser.Gestures.SwipeDown, function() { console.log("Swiped down"); });

There's still tons of room for improvement here, but it's a start. Also, this is my first contrib to a JavaScript project so any amendments to style and form are encouraged.

Thanks :)