add R key to restart game

This commit is contained in:
Gabriele Cirulli
2014-03-22 16:35:47 +01:00
parent a6531b08bd
commit 4ad15d4cbd
+5
View File
@@ -61,6 +61,11 @@ KeyboardInputManager.prototype.listen = function () {
self.emit("move", mapped); self.emit("move", mapped);
} }
} }
// R key restarts the game
if (!modifiers && event.which === 82) {
self.restart.call(self, event);
}
}); });
// Respond to button presses // Respond to button presses