From 4ad15d4cbd224fd36d4f1139ebb28c6b4af1ad6d Mon Sep 17 00:00:00 2001 From: Gabriele Cirulli Date: Sat, 22 Mar 2014 16:35:47 +0100 Subject: [PATCH] add R key to restart game --- js/keyboard_input_manager.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/keyboard_input_manager.js b/js/keyboard_input_manager.js index 4f2e856..32a177a 100644 --- a/js/keyboard_input_manager.js +++ b/js/keyboard_input_manager.js @@ -61,6 +61,11 @@ KeyboardInputManager.prototype.listen = function () { self.emit("move", mapped); } } + + // R key restarts the game + if (!modifiers && event.which === 82) { + self.restart.call(self, event); + } }); // Respond to button presses