feat: add configurable removedCells option and comprehensive documentation
- Add removedCells to GameOptions for custom puzzle sizes - removedCells overrides difficulty default when provided - Maintain backward compatibility with all defaults - Complete IMPLEMENTATION.md with Iteration 16 and summary - Completely rewrite README.md with comprehensive documentation: - Complete API reference (GameOptions, GameManager, CursorManager, ScoreManager) - Game states and state machine flow - Full VIM controls reference (movement, editing, hints, game control) - Cell state rules and visual feedback - Detailed scoring formula with examples - Game-over conditions (time and hint limits) - Hint system priority and penalties - Configuration examples for different play styles - Platform hook integration guide - Mark implementation as COMPLETE and PRODUCTION READY
This commit is contained in:
+3
-3
@@ -7,7 +7,7 @@ import { useCursorRender } from './useCursor/useCursorRender';
|
||||
import { useScore } from './useScore';
|
||||
|
||||
export function useGame(options: GameOptions = {}, platformHook?: unknown): GameManager {
|
||||
const { difficulty = 'easy', timeLimit = 600 } = options;
|
||||
const { difficulty = 'easy', timeLimit = 600, removedCells } = options;
|
||||
const board = useBoard();
|
||||
const { containerRef, renderBoard, generateBoard, boardRendered } = board;
|
||||
|
||||
@@ -51,12 +51,12 @@ export function useGame(options: GameOptions = {}, platformHook?: unknown): Game
|
||||
|
||||
useEffect(() => {
|
||||
if (gameStatus === 'started') {
|
||||
generateBoard(difficulty);
|
||||
generateBoard(difficulty, removedCells);
|
||||
renderBoard();
|
||||
} else if (gameStatus === 'waiting') {
|
||||
renderBoard();
|
||||
}
|
||||
}, [gameStatus, difficulty]);
|
||||
}, [gameStatus, difficulty, removedCells]);
|
||||
|
||||
const gameManager: GameManager = {
|
||||
containerRef,
|
||||
|
||||
Reference in New Issue
Block a user