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:
+1
-1
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user