tower.module
README.md
game.tower — the tower
Saltcrown's hero asset: the sea-pillar and every course the player raises on it. The camera never leaves this thing, so it is built to be looked at.
What it draws
-
The pillar. Wave-cut granite from the seabed up to the cut shoulder, with outcrops breaking the silhouette and a quarried platform where the first stone was laid.
-
A floor per course. A drum of cut masonry with a plinth, a string course and a projecting cornice, plus the fittings its archetype needs — so a granary is a granary at a glance:
Archetype What you see Cistern An open tank with water standing in it, lead downpipes clipped down the outside, overflow spouts throwing clear of the stone Granary A boarded timber upper storey, vent slits, and a loading gantry with a sack on the hook Workshop Open work bays with the forge lit in one, a banker ledge of cut blocks, and a crane swinging a stone out over the sea Dormitory A timber gallery right round, two courses of lamplit windows set in stone reveals, and a chimney Shrine A colonnade in pale ashlar under an architrave, cold lancet windows, and the bell they ring when a floor goes under Kiln Two arched mouths with the coal bed burning in them, a tall flue, fuel stacked on a ledge, and soot climbing the courses -
The cage. Timber standards, a plank walkway at every course, braces and rope lashings, a jib hoist with a stone on the line, a windlass, and the worksite deck on the head of the stack with the next course waiting on it.
-
The crown. A crenellated parapet and a lit beacon — built only when the eighteenth course stands.
The waterline
Three shaders — scGranite, scTimber, scLamp — take a water_y in world
space, and update() pushes Core.tideY() into all of them. So the sea is
drawn on the stone: a dark soaked band fading up out of the water, weed
where the tide sits, a crust of salt bloom above it in the mortar and on the
ledges, and everything below fading into the sea colour with depth so a
drowned floor stays a legible shape rather than disappearing.
That is also why there are no per-state materials. A floor is doomed, drowned or standing because of where the water is, and the water already knows.
How it is driven
Nothing calls into this module. It listens on the gamecore bus
(floorPlaced, floorComplete, floorDoomed, floorDrowned,
floorSacrificed) and, every frame, reconciles what it has drawn against
Core.state.floors — so a floor that changes without an event is still drawn
correctly on the next tick.
Everything it spawns is temporary, under FloorRoot and ScaffoldRoot, and
is rebuilt from scratch on install().