From ec67fc7bbbde45a284979b2b6659fb03ca7f15eb Mon Sep 17 00:00:00 2001 From: Bocom Date: Sun, 4 Oct 2020 00:57:07 +0200 Subject: [PATCH] Add keyboard shortcut for restarting the level --- index.html | 2 +- js/main.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 2b72c4a..53917a6 100644 --- a/index.html +++ b/index.html @@ -118,7 +118,7 @@
- +
diff --git a/js/main.js b/js/main.js index c40b899..e352038 100644 --- a/js/main.js +++ b/js/main.js @@ -444,6 +444,13 @@ class Player extends PrimaryView { } } + if (ev.key === 'r') { + if (this.state === 'playing') { + this.restart_level(); + return; + } + } + if (this.key_mapping[ev.key]) { this.current_keys.add(ev.key); ev.stopPropagation();