feat(ludic.base): the vocabulary mechanic packages share - Tick, phases, Queue<T>, rng streams, the save tree, the system runner
A mechanic package depends on ludic.base and nothing else: ports (records of function values for now) for questions, queues for facts, verbs for changes, phases for order and its own versioned save section. The runner inits, resets, saves and loads systems in the order added and ticks them phase by phase; a missing save section is a reset. Tests for each piece and a worked route between two toy mechanics live under tests/. The old ludic.core (engine ECS components) is used by examples/library and stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
ec9a650e65
commit
dd6a449921
16 changed files with 928 additions and 0 deletions
23
packages/ludic.base/tick.ludic
Normal file
23
packages/ludic.base/tick.ludic
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# ludic.base/tick.ludic - what one frame hands a system, and the phases that order systems. A
|
||||
# system names its phase; the game's list orders systems within one. Nobody says "after X".
|
||||
export property Tick {
|
||||
dt: float = 0.0
|
||||
frame: int = 0
|
||||
hours: float = 0.0
|
||||
}
|
||||
|
||||
export const PH_INPUT: int = 0
|
||||
export const PH_SENSE: int = 1
|
||||
export const PH_SIMULATE: int = 2
|
||||
export const PH_RESOLVE: int = 3
|
||||
export const PH_COMMIT: int = 4
|
||||
export const PH_PRESENT: int = 5
|
||||
export const PH_COUNT: int = 6
|
||||
|
||||
export function tick_new(dt: float, frame: int, hours: float) -> Tick {
|
||||
let t = new Tick
|
||||
t.dt = dt
|
||||
t.frame = frame
|
||||
t.hours = hours
|
||||
return t
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue