feat(ludic.tracks): prints, their age and reading them as a mechanic package

A ring of prints per kind; a port for the trip's time, the reader's tier, a
bearing in words and a hook the game draws each print through. A read is a
TrackRead fact on tracks_reads() every time and a count the first time; other
sign is told with tracks_note. The count and last bearing are its save section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 04:54:43 +03:00
parent 093ca0d260
commit bf73f7edaf
10 changed files with 487 additions and 0 deletions

View file

@ -0,0 +1,31 @@
# system.ludic - the reader as a system: what has been read and the last bearing are saved; the
# prints themselves are the ground's and are not (the animals leave new ones)
export function tracks_reset() -> void {
tk_read_n = 0
tk_yaw = 0.0
tk_has_yaw = false
q_clear(tracks_reads())
}
export function tracks_save() -> Val {
let v = Value.object()
sv_put_int(v, "read", tk_read_n)
sv_put_bool(v, "has_yaw", tk_has_yaw)
sv_put_float(v, "yaw", tk_yaw)
return v
}
export function tracks_load(v: Val, version: int) -> void {
tracks_reset()
tk_read_n = sv_int(v, "read", 0)
tk_has_yaw = sv_bool(v, "has_yaw", false)
tk_yaw = sv_float(v, "yaw", 0.0)
}
export function tracks_system() -> System {
let s = system_new("tracks", PH_SIMULATE)
s.reset = fn tracks_reset
s.save = fn tracks_save
s.load = fn tracks_load
return s
}