Commit Graph
10 Commits
Author SHA1 Message Date
pastilhas 5cbb2ee94c refactor: make all GameOptions optional with sensible defaults
- cols defaults to 30 (was required)
- rows defaults to 20 (was required)
- timeLimit and startingLevel remain optional
- Can now call useGame() with no arguments
- Example: useGame(), useGame({}), useGame({ startingLevel: 5 })
2025-10-31 00:19:43 +00:00
pastilhas ad82eaff7c refactor: enforce new GameOptions signature for useGame
- Remove old signature support (cols, rows, platformHook)
- useGame now requires GameOptions object only
- Update example app to use new signature
- Signature: useGame(options, platformHook?)
2025-10-31 00:17:36 +00:00
pastilhas 2dcab21a04 test(phase2): update example app to display metrics
- Display totalKeystrokes from scoreManager
- Display finalScore when game ends (game-over or game-won)
- Changed 'Keys' label to 'Keystrokes' for clarity
- Added 'game-won' status message
2025-10-30 23:57:40 +00:00
pastilhas f9cd9c60e7 fix(example): update useKeyBindings to work with new GameManager interface
- Import GameManager type directly from main package
- Use new Unified API methods: renderBoard, quitGame, clearKeyLog
- Remove pause functionality for now (simplified like vim-maze)
- Match vim-maze's key binding pattern
- Game now starts and plays correctly
2025-10-30 22:30:00 +00:00
pastilhas 2b3a55df37 before Unified API 2025-10-30 22:14:04 +00:00
pastilhas d02a8e9618 working on levels 2025-10-16 17:18:31 +01:00
pastilhas e4f5be1a56 food! 2025-10-16 16:22:09 +01:00
pastilhas 20ac6b9349 proper keybindings 2025-10-16 13:21:22 +01:00
pastilhas 6a3cfad409 game start/stop, snake rendered on board 2025-10-16 12:56:15 +01:00
pastilhas 892e85ecf5 board consumed in example 2025-10-16 12:25:52 +01:00