TableTower/README.md
RobinFiredrake 60c2d03147 Build the pipe-board app in Godot
Tables are cards on a felt board, joined by copper pipes that carry a
roll from one table to the next. Play mode rolls with a flicker and a
bead down each pipe; Build mode edits names, results, ranges and pipes.

- core/: data model (RollTable, TableEntry, TowerBoard), sample board
  with a d100 table of 100 trinkets and a weighted d100 range table,
  and a Roller with a depth limit
- ui/: board with pan and zoom, pipe and port layers, collapsible table
  cards, result tray with earlier rolls, undo toasts, and a Collapse all
  / Expand all button
- assets/fonts/: Rokkitt and Atkinson Hyperlegible (SIL OFL)
- tests/test_roller.gd: headless checks for the model and roller

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:05:41 -06:00

58 lines
2.1 KiB
Markdown

# TableTower
Random roll tables for tabletop games, built as a board of table cards joined by pipes.
Click the die on any table and the result flows down its pipes into the next table.
Made with Godot 4.7 (GDScript).
## Running
Open `project.godot` in Godot 4.7.x and press Play, or from a terminal:
```sh
godot --path .
```
## Using it
- **Play mode** is for the game table. Click a die to roll. The results flicker, one lands,
and a bead runs down any pipe into the next table. The tray at the bottom shows the whole
chain and the last few rolls.
- **Build mode** is for setting up tables. Edit names and results in place, add or delete
results and tables, and drag a card by its header. Drag from a result's ● onto another
table to lay a pipe. Click a pipe to remove it. Deletions can be undone from the toast.
- **Ranged tables** (like *Wilderness Travel*) roll a d100 where each range's size sets its
chance. Each range takes one pipe; laying a new one replaces the old.
- **Collapsing:** the arrow beside a table's name collapses it. A collapsed table still shows
its last result. **Collapse all / Expand all** in the top bar does every table at once.
- **Moving around:** drag the felt to pan, use the mouse wheel to scroll (Shift for sideways),
Ctrl+wheel or pinch to zoom, and **Fit** to see every table.
The board saves automatically to `user://board.json`
(on Linux, `~/.local/share/godot/app_userdata/TableTower/board.json`).
**Reset sample** in Build mode restores the example tables.
## Layout
```
core/ data model and roller (no UI; testable headless)
ui/ main scene, board view, cards, pipes, ports, result tray, styles
assets/ fonts (Rokkitt and Atkinson Hyperlegible, both SIL OFL)
tests/ headless checks
docs/ design document
```
## Tests
```sh
godot --headless --path . -s res://tests/test_roller.gd
```
## Screenshots from the command line
```sh
godot --path . -- --screenshot=/tmp/board.png [--build] [--expand-all] [--collapse-all] \
[--roll=wilderness] [--shot-delay=0.75]
```
This uses the sample board and doesn't save anything.