Log inGet started
World

Verdigris Cloister

Branchmain
Branchesmain
Commit65770846aa

README.md

game.cam.board

What the floor says. This module owns the tint and the outline of the 80 tile_<x>_<y> plates under the Board anchor, and the marker geometry that sits on top of them.

local Board = require("game.cam.board")

Board.attach()                         -- find the plates (safe to repeat)
Board.buildMarkers(entity.find("Board"))
Board.paint(view, pulse)               -- the plates
Board.placeMarkers(view, pulse)        -- the slabs, rings, chevrons and pin
Board.rest()                           -- nothing selected

The view

One table describes everything the board is saying:

KeyWhat it is
tilesThe referee's tile table — blight, fire and water colour the floor.
reachableA set keyed by Core.key.
reachInfoThe referee's own cell records, keyed the same way: AP cost, cover, danger.
pathSet / pathThe previewed walk, as a set and as an ordered list.
destThe tile the walk ends on.
selectedThe selected unit's tile.
hoverThe tile under the pointer.
threatA set of tiles something is covering.

Why highlights are emissive geometry, not tint

The greenhouse is a dark room lit in shafts. A tile's tint is lit like any other surface, so in the shadow between two shafts it falls to black — and a highlight the player cannot see is not a highlight.

Two things survive that, and the module leans on both:

  • The plate's outline is drawn unlit, so every plate carries a faint grout line and the grid is a grid in the dark as well as the light.
  • Emissive geometry carries its own light, so every highlight is a thin emissive slab (cam_ov_*) laid a hair over the plate rather than a tint on it, and the rings, chevrons and destination pin (cam_mk_*) are emissive too.

Reading a turn without counting tiles

reachInfo carries the AP a step costs, so one action point away is drawn as the bright near ring and two as a cooler far ring. A tile the referee marks dangerous goes red, edge and all.

Elevation

topOf(x, y, lift) reads the plate's live transform rather than the grid, so a tile a root-knot has heaved up carries its ring, its chevron and its highlight slab up with it.

Names it owns

cam_ov_1 … cam_ov_60 (highlight slabs) and cam_mk_* (selectRing, hoverRing, destPin, pip_1 … pip_24). buildMarkers sweeps both sets from the live world before rebuilding, so a hot reload never leaves a second copy behind.