Director
The camera brain of *Helsinki Life*. One shared table every camera in the world reads, so each player's own `BoardCam` clone puts its rig on the same shot.
Director
The camera brain of Helsinki Life. One shared table every camera in the world
reads, so each player's own BoardCam clone puts its rig on the same shot.
local Director = require("game.stage.Director")
Director.setViewport(w, h) -- the live frame, every frame
Director.tick(dt) -- advance (only the first caller of a frame does work)
local p = Director.pose() -- { eye = {x,y,z}, look = {x,y,z}, fov }
Four framings own the frame, in this order of authority:
| What it is | Who cues it | |
|---|---|---|
| beat | a keyframed cinematic: the opening flyover, the wedding at the Cathedral, the arrival at Suomenlinna, the end card's pull-back | Director.beat(name, payload), the Stage component, from HL.emit("beat", …) |
| overview | the whole peninsula from above, with pan and zoom | Director.toggleOverview() / HL.actions.toggleOverview() |
| attract | a slow arc over the sea while no game is running | automatic while there is no state, or the phase is title / setup |
| follow | south of and above HL.state().focus, looking north up the board | the default |
Every framing derives from the live screen shape. The follow shot keeps a fixed ground radius around the pawn inside the frame on both axes, so a 3:4 phone stands further back than a 21:9 television does. Where in the frame the pawn sits follows the same reading: a tall screen spends its top on the turn banner and the player column and its bottom on the caption strip, so the pawn is placed in the clear band between them, a little below centre; a wide screen gives the column a side instead and wants the pawn nearly centred. The overview fits the extent the game is actually played over, every tile and every landmark, to whichever axis the shape makes scarce.
Pan reads its device the way that device means it. A key or a stick reports how
hard it is held, so the reading is integrated over time at panSpeed; a finger
or a mouse reports how far it moved this frame, so the reading is spent at once
against what a pixel is worth on the ground, and the map comes with the finger.
Director.report() returns the mode, the running beat, the aspect and the pose
- what a test reads to prove where the camera is.
Scoped to this part · feeds back into the world's score.