- 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
- Show optimal steps required for the maze
- Display player efficiency percentage (100% = perfect play)
- Metrics appear after maze loads (when optimalSteps > 0)
- Separated from final score with visual divider
- Helps players understand their navigation performance
- Calculate optimal path from entrance to key to exit using maze.getDistance()
- Compute efficiency as keystroke ratio to optimal steps (percentage)
- Add optimalSteps and efficiency to ScoreManager return value
- No game-over trigger on efficiency threshold (preserved for future use)
- Metrics available for display and potential future scoring enhancements
Update findAnchorTarget to accept optional hasKey parameter. When player has the key and moving to an anchor (gg, G, ^, or $), if an exit is positioned at the edge, allow movement to reach it. This matches behavior of counted moves like 5k that can reach edge-positioned exits.
Remove validateAnchorMove function that called useMazeNavigation hook inside a regular function, which violates React's rules of hooks. Use the existing navigator instance directly in anchor movement methods instead.
- Export gameInfo object with complete game documentation
- Includes controls (navigation, game)
- Includes rules (movement, game flow, maze elements)
- Includes scoring (formula, penalties, size multiplier, examples)
- Includes game-over conditions
- Includes maze generation details
- Includes tracked metrics
- Structured for easy platform rendering
- Fully typed with GameInfo type
- Add timeLimit to GameOptions (default 600 seconds)
- Game-over triggers when time limit exceeded
- Remove all efficiency-based game-over logic
- Pass timeLimit through to useScore
- Check time limit during started and has-key states
- Add useMazeNavigation for pure maze geometry and path validation
- Add useVimMotions for pure Vim-style input parsing
- Add useAnimation for pure movement animation system
- Refactor useCursor to use specialized hooks with cleaner interface
- Refactor useHero to pure game logic without DOM manipulation
- Refactor useHeroRender to pure visual presentation layer
- Fix dual position system - hero position now authoritative
- Replace global events with callback props and return values
- Implement state-driven rendering instead of direct DOM queries
- Update GameManager interface with new HeroManager and HeroRenderer
- Maintain backward compatibility with legacy Cursor type
- Update UNIFIED_API.md with new architecture and interfaces
- Update GameStatus type to use kebab-case convention
- Change all occurrences in useHero.ts
- Update UNIFIED_API.md documentation
- Maintains consistency with other status values
- Move useKeyBindings functionality into useCursor as useGameKeys
- Flatten GameManager interface using intersection types
- Rename clearLog/getLog to clearKeyLog/getKeyLog for clarity
- Remove separate useKeyBindings module and exports
- Update all documentation to reflect new architecture
- Maintain backward compatibility for platform hooks