Document tests and runtime diagnostics

This commit is contained in:
Admin 2026-09-18 00:36:02 +00:00
parent f8a08f78b1
commit 0366eeffe8

View File

@ -1,3 +1,42 @@
# airship-phaser # airship-phaser
Top-down Phaser.js airship combat prototype Top-down Phaser.js airship combat prototype.
## Development
```bash
npm install
npm test
npm run dev
```
Production builds run the regression suite before Vite:
```bash
npm run build
```
## Runtime diagnostics
The browser keeps the latest 300 structured events in memory.
In Chrome DevTools:
```js
airshipDebug.getLogs()
airshipDebug.snapshot()
airshipDebug.clearLogs()
```
Useful events include:
- `scene:init`, `scene:create`, `scene:heartbeat`, `scene:shutdown`
- `combat:broadside-fired`
- `combat:player-hit-queued`
- `combat:player-hit-processed`
- `combat:pirate-hit`
- `game:finish`
- `hud:image-error`, `hud:helm-frame-error`, `hud:helm-knob-error`
- `runtime:error`, `runtime:unhandled-rejection`
If gameplay appears frozen, inspect `airshipDebug.snapshot()` first, then the tail of `airshipDebug.getLogs()`.