feat: add custom gameOver condition to GameOptions
- Add optional gameOver field to GameOptions - Can be a boolean value or a function that receives scoreManager - Function receives current score metrics to make dynamic decisions - Enables flexible game-over conditions beyond just time limit - Example: gameOver: (sm) => sm.efficiency > 150 for efficiency threshold - Checked every frame during 'started' and 'has-key' states
This commit is contained in:
@@ -12,6 +12,7 @@ export type GameOptions = {
|
||||
rows: number;
|
||||
cols: number;
|
||||
timeLimit?: number;
|
||||
gameOver?: boolean | ((scoreManager: ScoreManager) => boolean);
|
||||
};
|
||||
|
||||
export type KeyLogEntry = { key: string; timestamp: number };
|
||||
|
||||
Reference in New Issue
Block a user