@jamunlabs/gameu-tictactoe
v0.1.0
Published
Tic-tac-toe — gameu game
Readme
gameu-tictactoe
Classic 3×3 tic-tac-toe for the gameu lobby host.
- 2 players, turn-based.
- DOM renderer (no canvas / WebGL).
- Phone controller uses the host's built-in
board_grid3x3template — no custom controller bundle.
This game lives outside the gameu host repo as part of the
gameu-games decoupling — each game ships in its own
repo, npm-package-shaped, and reaches the host via POST /api/install
(catalog tier) or via --external-game-dir (local dev).
Dev loop
Today, run from a gameu source clone:
cargo xtask run-game --game-dir /path/to/gameu-tictactoeOnce @jamunlabs/gameu-cli ships to npm, the workflow becomes:
npm i -g @jamunlabs/gameu-cli
cd gameu-tictactoe
gameu devBuild
npm install
npm run build # tsc -p tsconfig.json
gameu build # validates manifest + produces .tgz via npm packLayout
| File | Purpose |
|---|---|
| manifest.json | Bundle manifest (id, runtime, player counts, sdk_version) — validated by the host on install. |
| index.html | TV-side game iframe entry point. |
| game.js | Boots the GameRunner with TicTacToeReducer + TicTacToeRenderer. |
| reducer.js | Pure synchronous update(event, model) → { model, effects }. |
| renderer.js | DOM renderer. Build-once + mutate per cell — no innerHTML rewrite on each tick. |
| dev_mode.js | Auto-drive resolvers gated on ?dev=1. |
| *.ts | TypeScript source (compiled to the .js files via npm run build). |
Runtime contract
- Loads
/lib/gameu-v1.js,/lib/gameu-sound-v1.js,/lib/bridge-schema.jsfrom the host (these stay versioned at the host level). import { ... } from "@jamunlabs/gameu-sdk"resolves via the host's<script type="importmap">to/sdk/index.js.- Sandboxed iframe (no
allow-same-origin); all communication is via the game-bridgepostMessagechannel.
