mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 08:11:54 +08:00
Add swipe support. Modules can implement swipeLeft (etc). Swipes control movement in the World module (map).
This commit is contained in:
+17
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user