ludic/packages/ludic.base/tick.ludic
Orkuncakilkaya dd6a449921 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>
2026-09-25 04:01:16 +03:00

23 lines
646 B
Text

# 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
}