mirror of
https://github.com/He4eT/DotDashPit.git
synced 2026-05-05 01:47:22 +00:00
game: cleanup
This commit is contained in:
parent
f933cb8f5a
commit
d0e0b26411
1 changed files with 4 additions and 7 deletions
11
game.js
11
game.js
|
|
@ -182,7 +182,7 @@ function handleMorse() {
|
|||
const { key } = player
|
||||
const now = time()
|
||||
|
||||
const buttonPressed = [BTN_A, BTN_B, BTN_X, BTN_Y].map(btn).some(Boolean)
|
||||
const buttonPressed = [BTN_A, BTN_B, BTN_X, BTN_Y].some(btn)
|
||||
|
||||
/* Down */
|
||||
if (buttonPressed && !key.isDown) {
|
||||
|
|
@ -704,12 +704,9 @@ function drawSprite(spriteIndex, x, y) {
|
|||
}
|
||||
|
||||
function anyKeyPressed() {
|
||||
for (let i = 0; i < 8; i++) {
|
||||
if (btnp(i)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return arr(8)
|
||||
.map((_, i) => i)
|
||||
.some(btnp)
|
||||
}
|
||||
|
||||
/* Constants */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue