# ic_shutter
The shutter of a classic instant box camera: a short double mechanical snap of the leaf blades and a softer return click, ~0.15 s. Synthesised; played at the camera on every peer when it fires (`stations.InstantCamera`).
# focus
One interaction target at a time, chosen by aim. Every interactable (door, light switch, seat, TV, controller, the
Game Boy) offers itself each frame while the player is in its range; the focus picker takes the one the middle of the
screen looks at (turning counts fully, the follow camera's pitch only partly, since it cannot look straight down at a
table), and only when nothing is under the reticle the nearest one, favouring what is in front and bigger things. Only
the winner shows a prompt and only the winner acts on Interact.
Input contexts, innermost first (`Focus.context()`): `shelf` (cartridge shelf open: its own map `stations.shelf`
stands the player's and the held console's controls down; Back = Backspace / pad B closes it), `pad` (a controller in
hand: `stations.gamepad` stands the player's and hangout maps down; its own `pad_watch` frames the TV), `handheld` (the
Game Boy in hand: `stations.handheld`), `holding`, `seated`, `free`. With something in hand only an offer made with a
`press` callback is considered (a seat: sit with the item kept in hand; a held controller's "Cartridges"): it shows the
prompt and the `stations.holdInteract` map (E / pad right-stick click / touch "Use", live only then) calls `press`.
Seated, look (mouse / right stick) turns the seated view (`stations.seatView`), so the reticle picks among what lies on
the table. With a Game Boy in hand and standing, its close-up looks back at the player, so a `press` offer (a seat) is
found from the body instead: within reach of the chest, nearest first — walk up to a seat and press Interact to sit
with the Game Boy kept in hand.
The player's Carrier picks nothing up by itself (`stations.hands` binds its control to no device): each holdable's
own component offers itself here and picks itself up when it is the target.
```luau
local Focus = require("stations.focus")
-- update(): offer while in range (player-facing verb and object, aim radius in metres), withdraw otherwise
Focus.offer(public.entityId, targetEntity, "Open", "Door", 0.5)
Focus.withdraw(public.entityId)
-- in the Interact handler:
if not Focus.isTarget(public.entityId) then return end
```
# hui
The hangout's interface kit: one look for every screen, and the shared pieces each object draws through instead of
registering screens of its own.
- Look: warm frosted glass panels, cream ink, an amber accent for the hangout and a phosphor green for anything a
console shows. Headings in Bricolage Grotesque, text in Arimo, keys in JetBrains Mono on raised keycaps, small
retro kickers in Press Start 2P.
- `Hui.prompt(owner, key, verb, object?)` / `Hui.unprompt(owner)`: the one interaction prompt on screen. The most
recent offer wins; withdrawing it brings back the one under it, so prompts never stack or stick.
- `Hui.controls(owner, title, items)` / `Hui.uncontrols(owner)`: the controls bar for whatever the player is doing
(holding the Game Boy, a controller, seated). `items` = `{ { keys = { "Z" }, label = "A" }, ... }`.
- `Hui.toast(kicker, title, body?)`: a card that drops in at the top and leaves by itself.
- Building blocks for screens: `Hui.glass`, `Hui.text`, `Hui.keycap`, `Hui.keys`, `Hui.kicker`, `Hui.bar`,
`Hui.button`, `Hui.T` (tokens).
# ic_motor
The film motor of a classic instant box camera: a ~1.5 s geared whine with tooth chatter and the soft hiss of the print through the rollers, spinning up and down, ending in a small clunk. Synthesised; played at the camera on every peer right after the shutter by `stations.InstantCamera`.
# progress
Each player's hangout progression, kept on their own machine (runtime data, survives restarts) and shared
with the room as a small card.
- **Play time:** per console and per game, while you are the one playing (holding the Game Boy, or a
controller on a TV game with a game running).
- **XP and level:** playing earns 10 XP a minute (15 when two people play the TV together), hanging out with
at least one other person earns 2 a minute, milestones add a bonus. Level *n* needs `100 + 60 (n-1)` XP.
- **Milestones:** real things done in the room (first game, co-op on the TV, passing the Game Boy on,
uploading a cartridge, an hour on a console, playing every console, playing from the sofa...).
```lua
local Progress = require("stations.progress")
Progress.playing(consoleId, title, dt, coop) -- each frame you play
Progress.event("upload") -- "upload", "handover", "seated", "watched", "pinned"
Progress.photo() -- a photo taken with the instant camera
Progress.tick(dt) -- once a frame (HangoutHud does it)
Progress.level() -> (level, xpIntoLevel, xpForLevel)
Progress.cards() -> { {peer, name, level, xp, minutes, top, milestones} } -- everyone, you first
Progress.milestones() -> { {id, title, text, done} }
Progress.onToast(fn(title, text)) -- a milestone or level up
```
Channel: `progress.card` (each peer's card, on change and every 15 s; answered on `progress.hello`).
# instantCamModel
The instant camera (an unbranded 600-series style box camera, 118 x 107 x 148 mm) and its film print (88 x 107 mm) at true size, from the ZeroBlender models in `props/instantcam`.
```lua
local Cam = require("stations.instantCamModel")
local cam = Cam.InstantCamera("instant_camera", { synced = true }) -- root + `<name>_model` children
local photo = Cam.printVisual(printRoot, photoMaterial) -- frame, backing, photo surface
Cam.HALF, Cam.LENS, Cam.FLASH, Cam.SLOT, Cam.EYE, Cam.PRINT -- dimensions in the model's frame
```
Used by `stations.InstantCamera` and `stations.InstantPrint`.
# InstantPrint
One instant film print, on a runtime synced entity the instant camera spawns (with `Physics`, a thin `BoxCollider` and `Holdable`). It builds its own visual on every peer (`stations.instantCamModel.printVisual`) with its own `stations.instantPrint` film material, whose clock runs from the shot time so it develops identically everywhere, and asks the room for the photo (`stations.instantPhoto`) when this peer lacks it.
Fresh out of the camera it rides in the camera's film slot (`slotOf`, `ejectAt`) until someone takes it. Interact picks it up (or takes it down from a wall). Held: look closer, pin it where you aim (a wall, door or fridge: flush, with a slight tilt, kinematic), put it down flat on the table or floor in front, hand it over, throw it away. Pinned prints are remembered on the pinner's machine (`instantPhoto.keep`) and come back next session.
# instantPhoto
The instant camera's photographs, shared by `stations.InstantCamera` and `stations.InstantPrint`.
- `capture(pos, at, up?, fov?)` renders the scene once from a lens pose into a 320x320 target, reads it back and returns a JPEG (~15-25 KB). Yields.
- An image cache on every peer by id (`newId`, `put`, `has`, `bytes`, `texture`). `send(id)` carries an image to the other peers in base64 chunks on `icam.img`; `want(id)` asks the room on `icam.want` and whoever holds it answers, so a late joiner gets every print's image.
- `material(printId, imageId, seed, age)` makes the print's own `stations.instantPrint` material, its clock running from the print's age so it develops the same on every peer; the photo is bound when it arrives.
- `keep` / `forget` / `kept` remember the prints this player pinned (pose, image) in this world's runtime data on this machine, so their wall prints come back next session.