Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·originates fromworld 5164eb76-1…

core

The shared contract of **Mario Kart OrigoZ**. Every slice reads its rules here, so no slice hard-codes a number that belongs to the game.

by◐Cxrn·posted 19d ago
What it does

core

The shared contract of Mario Kart OrigoZ. Every slice reads its rules here, so no slice hard-codes a number that belongs to the game.

require("game.core") from anywhere in this world.

What it holds

FieldWhat it is
TITLE, PROMPT, ARTThe game's name, the pulsa J para jugar prompt, and the art-direction sentence — word for word from the reference pass, reused by every prompt.
CIRCUITSThe three circuits: id, name, laps, layout (ring / square / ribbon), racing surface, what lies beyond the edges, and half-width.
KARTHow a kart feels: max speed, acceleration, braking, turn rates, hop and gravity, drift multipliers, trick spin.
SURFACEWhat each surface does to you: road 100%, water 75%, grass 50%, space falls.
SPARKThe drift charge table: blue at 1.0s (0.5s boost), orange at 2.5s (1.25s), rainbow at 4.0s (2.5s).
BOOSTTrick 0.75s, mushroom 2.0s, feather 2.0s.
ITEMSCrate respawn (8s) and the mushroom / feather odds.
RESCUEHow Lakitu puts you back: drop height, lift speed, lift duration.
PHASE, flow, raceThe flow state machine and the live race clock.
recordsThe best time on each circuit, kept in runtime_data.world — shared and durable.

API

  • M.circuits(), M.circuit(id), M.circuitIndex(id)
  • M.register(name, api) / M.system(name) — how slices reach each other
  • M.on(name, fn) / M.emit(name, payload) — the slices' event bus (phase, circuit, lap, crate, boost, rescue, finish)
  • M.setPhase(p), M.selectCircuit(id), M.openControls(), M.beginRace(), M.startRace(), M.tick(dt), M.reachPoint(total), M.finishRace()
  • M.records.get(id) / M.records.set(id, ms) / M.records.all()
  • M.formatTime(ms) → "00:45.678", M.countdownLabel(seconds)
  • M.clamp, M.lerp, M.approach

Who reads what

  • kart — KART, SURFACE, SPARK, BOOST, RESCUE, race.
  • tracks — CIRCUITS, SURFACE, reachPoint, PHASE.
  • items — ITEMS, BOOST, FEATHER_LIFT, emit("crate").
  • screens — flow, race, records, formatTime, PHASE.
  • audio — on("phase"), on("boost"), on("crate"), on("finish").

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

Mario Kart OrigoZ — the game's shared contract. Every slice reads its rules from here: the circuits, the feel constants, the surface multipliers, the boost table, the flow state, the best-time records, and the little event bus the slices talk through. Nothing that lives here is hard-coded anywhere else.

circuits( ) →

Every circuit, in select-menu order.

examples

for _, c in ipairs(Core.CIRCUITS) do print(c.name) end

circuit(id: string) →

Look a circuit up by its id.

argtypedescription
idstringCircuit id (cheep, mumu, arcoiris).

examples

local c = Core.circuit("cheep")

circuitIndex(id: string) → number

The select-menu order index of a circuit.

argtypedescription
idstringCircuit id.

examples

local i = Core.circuitIndex("mumu")

register(name: string, api: any) → void

Publish a slice's API under a name other slices can find.

argtypedescription
namestringSlice name (kart, tracks, items, screens, audio).
apianyThe slice's public table.

examples

Core.register("tracks", Tracks)

system(name: string) → any

Reach another slice's API, or nil when that slice is not in the build.

argtypedescription
namestringSlice name.

examples

local Tracks = Core.system("tracks")

on(name: string, fn: (any) → void

Subscribe to a game event. The returned function unsubscribes.

argtypedescription
namestringEvent name (phase, circuit, crate, boost, rescue, finish).
fn(anyCalled with the event's payload.

examples

local off = Core.on("phase", function(p) print(p.phase) end)

emit(name: string, payload: any) → void

Fire a game event to every subscriber.

argtypedescription
namestringEvent name.
payloadanyWhatever the event carries.

examples

Core.emit("phase", { phase = "race" })

setPhase(phase: string) → void

Move the game to a phase and tell everyone.

argtypedescription
phasestringOne of M.PHASE.

examples

Core.setPhase(Core.PHASE.SELECT)

selectCircuit(id: string) → void

Choose the circuit the next race runs on.

argtypedescription
idstringCircuit id.

examples

Core.selectCircuit("cheep")

openControls( ) → void

Leave the title for the CONTROLES window.

examples

Core.openControls()

beginRace( ) → void

Put the racer on the line: countdown, then the race runs.

examples

Core.beginRace()

startRace( ) → void

The lights go out: the clock starts and the kart may move.

examples

Core.startRace()

tick(dt: number) → void

Advance the race clock. Called once a frame by the entry point.

argtypedescription
dtnumberSeconds since the last frame.

examples

Core.tick(dt)

reachPoint(total: number) → boolean

The kart reached the next lap or progress point.

argtypedescription
totalnumberTotal laps (points) the circuit asks for.

examples

local done = Core.reachPoint(4)

finishRace( ) → boolean

Cross the line for the last time: stop the clock and bank the time.

examples

Core.finishRace()

get(id: string) → number

The best time ever set on a circuit, in milliseconds (0 for none).

argtypedescription
idstringCircuit id.

examples

local ms = Core.records.get("cheep")

set(id: string, ms: number) → void

Bank a time on a circuit, keeping the fastest.

argtypedescription
idstringCircuit id.
msnumberThe time in milliseconds.

examples

Core.records.set("cheep", 45678)

all( ) →

Every circuit's best time, for the select menu.

examples

local bests = Core.records.all()

formatTime(ms: number) → string

A lap time as type: two digits of minutes, seconds, a dot, three digits of milliseconds — "00:45.678".

argtypedescription
msnumberMilliseconds.

examples

Core.formatTime(45678) -- "00:45.678"

countdownLabel(seconds: number) → string

A countdown number as a whole second ("3", "2", "1", "GO").

argtypedescription
secondsnumberRemaining seconds.

examples

Core.countdownLabel(2.3) -- "3"

clamp(v: number, lo: number, hi: number) → number

Clamp a number into a range.

argtypedescription
vnumber
lonumber
hinumber

examples

Core.clamp(v, 0, 1)

lerp(a: number, b: number, t: number) → number

Linear interpolation from a to b.

argtypedescription
anumber
bnumber
tnumber

examples

Core.lerp(0, 10, 0.25)

approach(a: number, b: number, rate: number, dt: number) → number

Frame-rate independent approach from a toward b. `rate` is the share of the remaining distance closed per second (0..1).

argtypedescription
anumber
bnumber
ratenumber
dtnumber

examples

Core.approach(0, 10, 0.2, dt)

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

3items
This part has no composite children. See the Files segment for its leaf payloads.
backing path · game/core.module

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ 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".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.