miaoda-game-grid-vision-react
v0.3.2
Published
React DOM bindings for persistent fog-of-war map state.
Maintainers
Readme
miaoda-game-grid-vision-react
React DOM bindings for persistent grid fog of war. It exposes a FogMap as a row-major view of hidden, explored, and visible tile states without rendering the map or creating a frame loop.
pnpm add miaoda-game-grid-vision-react miaoda-game-grid-vision-coreconst controller = new FogController({width: 40, height: 30});
const view = useFogView(controller);
controller.reveal(heroTile, 6, (x, y) => map.get(x, y) === 'wall');
return view.states.map((state, index) => <Tile key={index} visibility={state} />);Read tile (x, y) at states[y * width + x]. Call reveal, markExplored, or clear on the controller; the hook updates after committed changes. LOS/FOV rules and map collision belong to miaoda-game-grid-vision-core and the host.
