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?)
This commit is contained in:
2025-10-31 00:17:36 +00:00
parent 477bcdd9f3
commit ad82eaff7c
2 changed files with 5 additions and 21 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ import "@vimazing/vim-snake/game.css";
import { useKeyBindings } from "./useKeyBindings";
function App() {
const { containerRef, gameStatus, scoreManager, keyLog, score, level } = useGame(30, 20, useKeyBindings);
const { containerRef, gameStatus, scoreManager, keyLog, score, level } = useGame({ cols: 30, rows: 20 }, useKeyBindings);
const formatTime = (ms: number) => {
const seconds = Math.floor(ms / 1000);