diff --git a/app/README.md b/app/README.md index cf97b78..3b0b128 100644 --- a/app/README.md +++ b/app/README.md @@ -52,10 +52,10 @@ https://wakamaifondue.com/ ## Pluto Goals: Phase 2 -- [ ] pico8-style games - [ ] public tunnel for your NOSE webapps - [ ] public tunnel lives through reboots - [ ] self updating NOSE server - [ ] `pub/` static hosting in webapps - [ ] game/bin/www cartridges -- [ ] upload files to project +- [ ] upload files to projects +- [ ] pico8-style games diff --git a/app/nose/bin/tetris.ts b/app/nose/bin/tetris.ts index b61846a..6cc7638 100644 --- a/app/nose/bin/tetris.ts +++ b/app/nose/bin/tetris.ts @@ -193,7 +193,7 @@ export function update(_delta: number, input: InputState) { paused = !paused if (paused) return - if (input.justPressed.has(" ")) { + if (input.justPressed.has(" ") || input.justPressed.has("z")) { rotateShape() } diff --git a/app/src/js/game.ts b/app/src/js/game.ts index ddb581d..a4f6550 100644 --- a/app/src/js/game.ts +++ b/app/src/js/game.ts @@ -49,8 +49,8 @@ export async function handleGameStart(msg: Message) { canvas = createCanvas() canvas.focus() setStatus(msgId, "ok") - canvas.addEventListener("keydown", handleKeydown) - canvas.addEventListener("keyup", handleKeyup) + window.addEventListener("keydown", handleKeydown) + window.addEventListener("keyup", handleKeyup) window.addEventListener("resize", resizeCanvas) resizeCanvas() gameLoop(new GameContext(canvas.getContext("2d")!), game) @@ -137,6 +137,10 @@ function gameLoop(ctx: GameContext, game: Game) { function endGame() { running = false + window.removeEventListener("keydown", handleKeydown) + window.removeEventListener("keyup", handleKeyup) + window.removeEventListener("resize", resizeCanvas) + if (oldMode === "tall") browserCommands.mode?.() canvas.classList.remove("active")