Refactored input handling, so that arrow keys will always work on menus.

This commit is contained in:
Ishaan Bhardwaj
2020-11-10 20:08:34 -05:00
parent fd739dcfdf
commit a470b40def
4 changed files with 11 additions and 11 deletions

View File

@@ -71,11 +71,11 @@ function GameScene:render()
end
function GameScene:onInputPress(e)
if self.game.completed and (e.input == "menu_decide" or e.input == "menu_back") then
if self.game.completed and (e.input == "menu_decide" or e.input == "menu_back" or e.input == "retry") then
highscore_entry = self.game:getHighscoreData()
highscore_hash = self.game.hash .. "-" .. self.ruleset.hash
submitHighscore(highscore_hash, highscore_entry)
scene = ModeSelectScene()
scene = e.input == "retry" and GameScene(self.retry_mode, self.retry_ruleset) or ModeSelectScene()
elseif e.input == "retry" then
scene = GameScene(self.retry_mode, self.retry_ruleset)
elseif e.input == "menu_back" then