feat(packages): ludic.minimap - a map's logic: the explored fog over a grid of cells round an origin (revealed within a reach, a version for rebaking, explored as a share of the land over a core square, the grid as text for an older save), the player's marks (a cap, a symbol, a colour, the day, a name; the open one and the followed one, rubbing out, the last symbol reused, the nearest for a compass) and the view (world to window and back, zoom in steps and about a point, a drag, pick and place, the camp, you, a focus that never pulls back out, a scale bar, bounds); the world through a port; seen and marks in its own save section by key

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 09:45:59 +03:00
parent fe9d28bf4e
commit 73a376ac6c
13 changed files with 830 additions and 0 deletions

View file

@ -0,0 +1,23 @@
# ports.ludic - what a map asks the game: where its grid is centred, what is land, where you and
# the camp are, the day, and how far the view may be pushed. Unbound: a grid round the origin, all
# land, you and the camp at the origin on day 1, and nowhere the view may not go.
export port MinimapWorld {
origin_x: fn() -> float = fn mm__zero # the grid's centre
origin_z: fn() -> float = fn mm__zero
land: fn(float, float) -> bool = fn mm__land # "explored" counts land only
you_x: fn() -> float = fn mm__zero
you_z: fn() -> float = fn mm__zero
camp_x: fn() -> float = fn mm__zero
camp_z: fn() -> float = fn mm__zero
day: fn() -> int = fn mm__day # a mark remembers the day it was made
lo_x: fn() -> float = fn mm__lo # the view's centre stays inside these
lo_z: fn() -> float = fn mm__lo
hi_x: fn() -> float = fn mm__hi
hi_z: fn() -> float = fn mm__hi
}
function mm__zero() -> float { return 0.0 }
function mm__land(x: float, z: float) -> bool { return true }
function mm__day() -> int { return 1 }
function mm__lo() -> float { return -1000000000.0 }
function mm__hi() -> float { return 1000000000.0 }