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 { key } = player
|
||||||
const now = time()
|
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 */
|
/* Down */
|
||||||
if (buttonPressed && !key.isDown) {
|
if (buttonPressed && !key.isDown) {
|
||||||
|
|
@ -704,12 +704,9 @@ function drawSprite(spriteIndex, x, y) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function anyKeyPressed() {
|
function anyKeyPressed() {
|
||||||
for (let i = 0; i < 8; i++) {
|
return arr(8)
|
||||||
if (btnp(i)) {
|
.map((_, i) => i)
|
||||||
return true
|
.some(btnp)
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Constants */
|
/* Constants */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue