From 0e2596d1de241871e2194c9b5ca39360561c5eab Mon Sep 17 00:00:00 2001 From: He4eT Date: Mon, 9 Jun 2025 08:25:35 +0200 Subject: [PATCH] game: handle input after drawing --- game.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/game.js b/game.js index 541a9b2..cb483d1 100644 --- a/game.js +++ b/game.js @@ -149,9 +149,6 @@ function gameover() { function gameScreen() { checkColisions() - handleMoves() - // handleMorse() - spawnEnemies() moveEnemies() @@ -161,6 +158,8 @@ function gameScreen() { drawEnemies() drawPlayer() drawLetters() + + handleMoves() handleMorse() } @@ -247,8 +246,8 @@ function handleMorse() { // Hold if (buttonPressed && key.isDown) { - const dash = now - key.downAt > DOT_DASH_THRESHOLD - player.state = dash ? 'dash' : 'dot' + const isDash = now - key.downAt > DOT_DASH_THRESHOLD + player.state = isDash ? 'dash' : 'dot' playMorseKey(arena.waveSeed) }