Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·originates fromworld 5164eb76-1…

Kart

The driving model, the whole K button, the surface penalties, the Lakitu rescue and the chase camera. This is where the game's feel lives.

by◐Cxrn·posted 19d ago
What it does

kart — Mu Mu's kart

The driving model, the whole K button, the surface penalties, the Lakitu rescue and the chase camera. This is where the game's feel lives.

What is here

FileWhat it is
game/kart.module (game.kart)The slice's API — finds the local player's kart and asks it.
Kart.componentThe kart itself, on the scene's kart body. One instance per player.
KartCamera.componentThe chase camera, in the scene's CameraRig's behavior slot.
drive.inputMapA/D steer, J accelerate, K hop and drift, L item, O brake — keyboard, gamepad and touch on every control.

The controls

KeyWhat it does
JAccelerate.
OBrake; held past a stop, reverses.
A / DSteer left / right.
KAt a standstill, a small straight hop. While steering, a hop to the OPPOSITE side that lands into a drift the way you turned.
K held in a driftWheel sparks charge: blue at 1.0s, orange at 2.5s, rainbow at 4.0s. Releasing pays out 0.5s / 1.25s / 2.5s of boost for the colour that was showing.
K off a ramp lipA trick spin in the air; landing it pays out 0.75s of boost.
LUse the item in the slot.

The rules it enforces

  • Surfaces: sand/dirt/rainbow 100%, water 75%, grass 50%, space is not drivable at all. Any boost except the drift one cancels the penalty while it runs.
  • Lakitu: falling into space lifts the kart and sets it back down at the nearest point of the racing line, then hands control back.
  • Laps: tracks.advance is called only while the kart is on the racing surface, so falling past a line in space never counts as crossing it.

API (for the other slices)

local K = Core.system("kart")
K.player()                        -- the local kart entity, or nil
K.public()                        -- its component: item, speed, lap, charge
K.boost(seconds, "mushroom")      -- fire a boost
K.jump(Core.FEATHER_LIFT)         -- lift it (a feather)
K.placeOnTrack()                  -- put it on the line
K.teleport({ x, y, z }, yaw)      -- put it down anywhere
K.setLocked(true)                 -- hold it (countdown, menus)
K.held()                          -- the item string it is carrying

Who drives

Only the peer's own kart reads input. It decides that from the layer's local-player handle, from the entry point's player event, or — a world with one kart having only one candidate — from there being a single kart.

Verified

Driving on circuit 1: J accelerates, A/D steer, O stops it; the water caps the speed at exactly 24 m/s (75% of 32). On circuit 2: steering off the dirt onto the grass caps it at exactly 16 m/s (50%). K with D held hops into a drift; holding it charges to rainbow and releasing pays out the boost for the stage reached (1.25s at orange, timed from when the drift actually started, not from the hop). K off a ramp on circuit 3 spins a trick and landing pays out 0.75s. Driving off the rainbow ribbon drops the kart and Lakitu sets it back on the line. Crossing each gate in turn walks the lap counter up. The chase camera follows from low and close behind, and none of it depends on the engine's frame rate (the step is clamped).

Interface

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

conforms to

zero/source-extract/v2

Kart — Mu Mu's kart: the driving model and the K button. (Reload sentinel: a real edit here makes the engine rebuild every live instance, which is what re-claims this kart's own control scheme.) Lives on the scene's PlayerPrototype body, so every player who joins gets their own kart and their own copy of this component. Only the peer's own kart reads input; the others replicate their motion. The whole feel of the game is here: J accelerate, O brake, A/D steer. K, standing still -> a small straight hop. K, while steering -> a hop to the OPPOSITE side that lands into a drift the way you were turning. K, held in a drift -> wheel sparks charge: blue at 1.0 s, orange at 2.5 s, rainbow at 4.0 s. Let go and the colour you were showing pays out 0.5 / 1.25 / 2.5 s of boost. K, off a ramp lip -> a trick spin that does nothing until you land, then 0.75 s of boost. Water caps the speed at 75% and grass at 50%; any boost except the drift one cancels that penalty for as long as it runs; the empty space beyond Senda Arcoiris cannot be driven on at all and Lakitu lifts the kart back to the nearest point of the racing line. Every number is read from game.core.

Model

stateOf(id: string) → KartState

argtypedescription
idstring

hsv(h: number, s: number, v: number) → void

argtypedescription
hnumber
snumber
vnumber

buildVisuals( ) → void

piece(name: string, pos: { number }, scale: any, colour: { number }, mesh: any?, axis: any?) → void

argtypedescription
namestring
pos{ number }
scaleany
colour{ number }
meshany?
axisany?

spark(name: string, x: number) → void

Wheel sparks: material-less emissive puffs that show while drifting.

argtypedescription
namestring
xnumber

racing( ) → boolean

alive( ) → boolean

A subscription made from inside a component outlives the entity it belongs to (the slices talk over Core's own bus, which the engine does not clean up for us), so every handler checks that its kart is still there.

placeOnTrack(st: KartState) → void

argtypedescription
stKartState

fireBoost(st: KartState, seconds: number, source: string) → void

argtypedescription
stKartState
secondsnumber
sourcestring

beginRescue(st: KartState) → void

argtypedescription
stKartState

landTrick(st: KartState) → void

argtypedescription
stKartState

stepDrift(st: KartState, dt: number, grounded: boolean) → void

argtypedescription
stKartState
dtnumber
groundedboolean

stepSparks(st: KartState, dt: number) → void

argtypedescription
stKartState
dtnumber

stepRescue(st: KartState, dt: number) → boolean

argtypedescription
stKartState
dtnumber

drive(st: KartState, dt: number, surface: string) → void

argtypedescription
stKartState
dtnumber
surfacestring

ancestorOrSelf(e: any, ids: { string }) → boolean

The peer's own kart is the only one that reads input. The layer's local-player handle answers when the engine has one; the entry point's `player` event covers the rest; and a world holding one kart has only one possible answer.

argtypedescription
eany
ids{ string }

idsOf(holder: any) → void

argtypedescription
holderany

pressDrift(st: KartState) → void

argtypedescription
stKartState

releaseDrift(st: KartState) → void

argtypedescription
stKartState

useItem(st: KartState) → void

argtypedescription
stKartState

activateControls(st: KartState) → void

argtypedescription
stKartState

takeTheWheel(st: KartState) → void

argtypedescription
stKartState

decideLocal(st: KartState) → void

argtypedescription
stKartState

boost(seconds: number, source: string?) → void

Fire a boost on this kart.

argtypedescription
secondsnumberHow long the boost lasts.
sourcestring?drift, trick, mushroom or feather.

examples

entity.findById(k).component.get("Kart"):boost(2.0, "mushroom")

jump(speed: number?) → void

Lift this kart off the ground (what a feather jump does).

argtypedescription
speednumber?Metres per second of lift.

placeOnTrack( ) → void

Put this kart on the active circuit's start line, at rest.

setLocked(locked: boolean) → void

Hold or release this kart.

argtypedescription
lockedbooleanTrue to hold it where it is.

teleport(pos: { number }, yaw: number?) → void

Put this kart down at a position, facing a heading, at rest.

argtypedescription
pos{ number }World position to land on.
yawnumber?Heading in radians.

wireEvents(st: KartState) → void

argtypedescription
stKartState

awake( ) → void

start( ) → void

update(dt: number) → void

argtypedescription
dtnumber

onDestroy( ) → void

Sub-parts

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

7items
▣
module · born here
❒asset
# 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 | Field | What it is | |---|---| | `TITLE`, `PROMPT`, `ART` | The 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. | | `CIRCUITS` | The three circuits: id, name, laps, layout (`ring` / `square` / `ribbon`), racing surface, what lies beyond the edges, and half-width. | | `KART` | How a kart feels: max speed, acceleration, braking, turn rates, hop and gravity, drift multipliers, trick spin. | | `SURFACE` | What each surface does to you: `road` 100%, `water` 75%, `grass` 50%, `space` falls. | | `SPARK` | The drift charge table: blue at 1.0s (0.5s boost), orange at 2.5s (1.25s), rainbow at 4.0s (2.5s). | | `BOOST` | Trick 0.75s, mushroom 2.0s, feather 2.0s. | | `ITEMS` | Crate respawn (8s) and the mushroom / feather odds. | | `RESCUE` | How Lakitu puts you back: drop height, lift speed, lift duration. | | `PHASE`, `flow`, `race` | The flow state machine and the live race clock. | | `records` | The 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")`.
▲ 0↑ born
backing path · game/kart/Kart.component

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.