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:
parent
093ca0d260
commit
bf73f7edaf
10 changed files with 487 additions and 0 deletions
37
packages/ludic.tracks/config.ludic
Normal file
37
packages/ludic.tracks/config.ludic
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# config.ludic - how many kinds of print, how many of each the ground remembers, how the reader
|
||||
# reads, and the port's defaults
|
||||
export function tracks_config(kinds: int, cap: int) -> void {
|
||||
tk_kinds = kinds
|
||||
tk_cap = cap
|
||||
tk_ring = new []Track
|
||||
tk_count = new []int
|
||||
tk_next = new []int
|
||||
for i in 0 .. kinds * cap { push(tk_ring, new Track) }
|
||||
for k in 0 .. kinds {
|
||||
push(tk_count, 0)
|
||||
push(tk_next, 0)
|
||||
}
|
||||
}
|
||||
|
||||
# a reader at `name_at` or above can tell the animal; a print is fresh under `fresh` hours old,
|
||||
# recent under `recent`, and old after
|
||||
export function tracks_config_reading(name_at: int, fresh: float, recent: float) -> void {
|
||||
tk_name_at = name_at
|
||||
tk_fresh_h = fresh
|
||||
tk_recent_h = recent
|
||||
}
|
||||
|
||||
function tk_now() -> float {
|
||||
if tk_world == null or tk_world.now == null { return 0.0 }
|
||||
return tk_world.now()
|
||||
}
|
||||
|
||||
function tk_named() -> bool {
|
||||
if tk_world == null or tk_world.skill == null { return true }
|
||||
return tk_world.skill() >= tk_name_at
|
||||
}
|
||||
|
||||
function tk_bearing(yaw: float) -> string {
|
||||
if tk_world == null or tk_world.bearing == null { return "" }
|
||||
return tk_world.bearing(yaw)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue