mirror of
https://github.com/He4eT/DotDashPit.git
synced 2026-05-05 01:47:22 +00:00
game: handle input after drawing
This commit is contained in:
parent
d9d8d4b0f0
commit
0e2596d1de
1 changed files with 4 additions and 5 deletions
9
game.js
9
game.js
|
|
@ -149,9 +149,6 @@ function gameover() {
|
||||||
function gameScreen() {
|
function gameScreen() {
|
||||||
checkColisions()
|
checkColisions()
|
||||||
|
|
||||||
handleMoves()
|
|
||||||
// handleMorse()
|
|
||||||
|
|
||||||
spawnEnemies()
|
spawnEnemies()
|
||||||
moveEnemies()
|
moveEnemies()
|
||||||
|
|
||||||
|
|
@ -161,6 +158,8 @@ function gameScreen() {
|
||||||
drawEnemies()
|
drawEnemies()
|
||||||
drawPlayer()
|
drawPlayer()
|
||||||
drawLetters()
|
drawLetters()
|
||||||
|
|
||||||
|
handleMoves()
|
||||||
handleMorse()
|
handleMorse()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -247,8 +246,8 @@ function handleMorse() {
|
||||||
|
|
||||||
// Hold
|
// Hold
|
||||||
if (buttonPressed && key.isDown) {
|
if (buttonPressed && key.isDown) {
|
||||||
const dash = now - key.downAt > DOT_DASH_THRESHOLD
|
const isDash = now - key.downAt > DOT_DASH_THRESHOLD
|
||||||
player.state = dash ? 'dash' : 'dot'
|
player.state = isDash ? 'dash' : 'dot'
|
||||||
playMorseKey(arena.waveSeed)
|
playMorseKey(arena.waveSeed)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue