gameInfo
This commit is contained in:
@@ -443,6 +443,34 @@ useGame({
|
||||
|
||||
---
|
||||
|
||||
## Game Instructions Export
|
||||
|
||||
The package exports a structured `gameInfo` object containing complete game documentation:
|
||||
|
||||
```typescript
|
||||
import { gameInfo } from '@vimazing/vim-sudoku';
|
||||
|
||||
// Access structured instructions
|
||||
console.log(gameInfo.name); // "VIM Sudoku"
|
||||
console.log(gameInfo.controls); // Navigation, editing, deletion, hints, game
|
||||
console.log(gameInfo.rules); // Cell types, modes, visual feedback
|
||||
console.log(gameInfo.scoring); // Formula, penalties, multipliers, examples
|
||||
console.log(gameInfo.gameOver); // Time and hint limit conditions
|
||||
console.log(gameInfo.hints); // How the hint system works
|
||||
console.log(gameInfo.objective); // Win condition
|
||||
```
|
||||
|
||||
**Use cases:**
|
||||
- Render in-game help screens
|
||||
- Generate tutorials
|
||||
- Display control reference
|
||||
- Show scoring breakdown
|
||||
- Explain game mechanics
|
||||
|
||||
All data is fully typed with the `GameInfo` type for type safety.
|
||||
|
||||
---
|
||||
|
||||
## Example App
|
||||
|
||||
A demo application lives under `example/` and consumes the package directly.
|
||||
|
||||
Reference in New Issue
Block a user