feat: enforce one active letter at a time (character mode)

- Add MAX_ACTIVE_LETTERS constant set to 1
- Only spawn new letter if no letters are currently active
- Prepare for future game modes (word, sentence, paragraph)
- Change keybindings to use Escape instead of Q
This commit is contained in:
2025-11-03 22:05:22 +00:00
parent 0dc4ecde72
commit 5a0d8b5221
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ function App() {
<div className="text-center text-sm text-muted-foreground">
{gameStatus === "waiting" && <p>Press <kbd className="px-2 py-1 bg-muted rounded">space</kbd> to start</p>}
{gameStatus === "started" && <p>Game running...</p>}
{gameStatus === "started" && <p>Type letters • Press <kbd className="px-2 py-1 bg-muted rounded">esc</kbd> to quit</p>}
{gameStatus === "game-over" && <p>Game Over! Press <kbd className="px-2 py-1 bg-muted rounded">space</kbd> to restart</p>}
{gameStatus === "game-won" && <p>You Won! Press <kbd className="px-2 py-1 bg-muted rounded">space</kbd> to restart</p>}
</div>
+1 -1
View File
@@ -25,7 +25,7 @@ export const useKeyBindings = (gameManager: GameManager) => {
if (gameStatus === "waiting") return;
// quit
if (ev.key === "q" || ev.key === "Q") {
if (ev.key === "Escape") {
quitGame();
return;
}