# Debugging

## VS Code

1. Open this folder in VS Code.
2. Run `Debug Heros Web (Chrome)` from Run and Debug.
3. VS Code starts the Vite dev server and opens Chrome at `http://localhost:5173`.
4. Set breakpoints in `src/game/scenes/*.ts`.

## Browser Console

Development builds expose:

```js
window.__HEROS_GAME__
window.__HEROS_DEBUG__
```

Useful commands:

```js
__HEROS_DEBUG__.activeScenes()
__HEROS_DEBUG__.battle()
__HEROS_DEBUG__.goToBattle()
__HEROS_DEBUG__.toggleBattleOverlay()
```

## Battle Hotkeys

- `F9`: Toggle battle debug overlay.
- `F10`: Log battle state to the browser console.

The battle debug state includes turn, phase, selected unit, pending move, acted units, unit coordinates, attack intents, and bond progress.
