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 })
This commit is contained in:
+2
-2
@@ -29,8 +29,8 @@ export type SnakeBody = Position[];
|
||||
export type KeyLogEntry = { key: string; timestamp: number };
|
||||
|
||||
export type GameOptions = {
|
||||
cols: number;
|
||||
rows: number;
|
||||
cols?: number;
|
||||
rows?: number;
|
||||
timeLimit?: number;
|
||||
startingLevel?: number;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user