gamecore
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
gamecore
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
floorBottomY(index: number) → number
Floors are indexed 1..MAX_FLOORS from the shoulder up.
| arg | type | description |
|---|---|---|
| index | number |
floorCenterY(index: number) → number
| arg | type | description |
|---|---|---|
| index | number |
floorTopY(index: number) → number
| arg | type | description |
|---|---|---|
| index | number |
seasonName(season: number) → string
| arg | type | description |
|---|---|---|
| season | number |
yearOf(season: number) → number
| arg | type | description |
|---|---|---|
| season | number |
tideYAt(season: number) → number
Waterline height for a (possibly fractional, possibly future) season.
| arg | type | description |
|---|---|---|
| season | number |
tideY( ) → number
The live waterline, including whatever sacrifices have bought back.
seasonReaching(y: number) → number
Which season the water reaches a given height. Binary search over the curve so the ledger can print "drowns in 6 seasons" without simulating.
| arg | type | description |
|---|---|---|
| y | number |
seasonsUntilDrowned(index: number) → number
Seasons of grace left for a floor before its FLOOR is underwater.
| arg | type | description |
|---|---|---|
| index | number |
archetype(id: string) → Archetype
| arg | type | description |
|---|---|---|
| id | string |
resetRun( ) → void
⚠ RELOAD SEMANTICS — read this before debugging strange state. Saving a module folds its new source into the SAME instance: where the old source and the new one both build a table at a key, THE OLD TABLE SURVIVES and the new keys land on it. So on every reload of this file the scalars above (season, stone, highestFloor…) snap back to the literals while `floors` KEEPS its old contents — a split-brain where highestFloor is 0 but floors[1] is still occupied, and placing a floor fails with "that course is already taken" for no visible reason. resetRun() is the cure and the entrypoint calls it on every scene load, so a run always starts from one coherent state. Call it yourself after editing this file if you are iterating inside a live session. It clears `floors` IN PLACE so any reference another slice is holding stays valid.
focusY( ) → number
The floor the camera and the ledger should be attending to: the top of what stands, or the waterline if the water has caught up with it.
on(event: string, fn: any) → void
`fn` is deliberately untyped: each event carries its own payload shape (documented in Core.EVENTS above), so a single typed signature here would reject every handler that names its own parameters.
| arg | type | description |
|---|---|---|
| event | string | |
| fn | any |
clearAll( ) → void
Empty the bus. The entrypoint calls this once per boot, before any slice installs, so no closure from a previous load survives.
emit(event: string, ...: any) → void
| arg | type | description |
|---|---|---|
| event | string | |
| ... | any |
Archetype = {Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.