Add swipe support. Modules can implement swipeLeft (etc). Swipes control movement in the World module (map).

This commit is contained in:
David Clark
2013-07-05 18:00:17 +10:00
committed by David Clark
parent 7f1efd4ad2
commit e9679b3f26
5 changed files with 761 additions and 2 deletions
+17 -1
View File
@@ -316,7 +316,23 @@ var World = {
break;
}
},
swipeLeft: function(e) {
World.moveWest();
},
swipeRight: function(e) {
World.moveEast();
},
swipeUp: function(e) {
World.moveNorth();
},
swipeDown: function(e) {
World.moveSouth();
},
click: function(event) {
var map = $('#map'),
// measure clicks relative to the centre of the current location