round
The Kart Sprint round itself, a table that follows Showrunner's round contract (`id = "kartSprint"`, `kind = "race"`, three arenas, three tunings, control labels, and `build`, `start`, `update`, `botThink`, `stop`). The show's host spawns a kart per contestant in their colour and…
round
The Kart Sprint round itself, a table that follows Showrunner's round contract (id = "kartSprint", kind = "race", three arenas, three tunings, control labels, and build, start, update, botThink, stop). The show's host spawns a kart per contestant in their colour and runs a headless racingKit race; computer players' karts are driven by racingKit's AI at their level; each person climbs into their own kart. Finishes become the show's finish order and race progress its score. Finishers watch from the winners' stand while the camera follows the leader. Register it on every machine with require("showrunner.api").registerRound(require("kartSprintRound.round")). showcase(arenaId, origin, tuningId) builds one arena alone, for a gallery or a menu backdrop.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
reset( ) → void
tuningOf(ctx: any) → any
| arg | type | description |
|---|---|---|
| ctx | any |
kartName(cid: string) → string
| arg | type | description |
|---|---|---|
| cid | string |
kartsNamed(cid: string) → void
Every kart named for contestant `cid` this machine sees (names are not unique: an earlier round's kart can still stand beside this round's).
| arg | type | description |
|---|---|---|
| cid | string |
sweepKarts(ids: { string }) → void
Host: removes the karts `ids` names. A kart is removed by the machine that owns it, and a person's kart belongs to that person's machine until they get out; once it has come to rest it belongs to nobody, and nobody would ever remove it (each later round then left one more kart of that name on the track, and that player's next kart drove half a second and stuck). The host takes each such kart and removes it. Karts are named by id, so a new round's kart of the same name is never touched.
| arg | type | description |
|---|---|---|
| ids | { string } |
director( ) → any
vehicleOf(e: any) → any
| arg | type | description |
|---|---|---|
| e | any |
rosterId(c: any, slot: number) → number
the roster id racingKit knows a contestant by: a person's peer id, a bot's negative slot
| arg | type | description |
|---|---|---|
| c | any | |
| slot | number |
contestantByRoster(ctx: any, id: number) → any
| arg | type | description |
|---|---|---|
| ctx | any | |
| id | number |
ordinal(n: number) → string
| arg | type | description |
|---|---|---|
| n | number |
spawnKarts(ctx: any, track: any) → void
| arg | type | description |
|---|---|---|
| ctx | any | |
| track | any |
seatOffset(v: any, body: any) → void
Where a body's feet go so its hips sit on the kart's driver seat, in the kart's own axes.
| arg | type | description |
|---|---|---|
| v | any | |
| body | any |
hostSetup(ctx: any) → void
The host claims the race and the bots' karts, hands the roster over and sits each bot's body in its kart.
| arg | type | description |
|---|---|---|
| ctx | any |
seatLocalPlayer(ctx: any) → void
Every machine: its own player climbs into the kart in their colour.
| arg | type | description |
|---|---|---|
| ctx | any |
buildArena(arenaId: string, t: any, o: any, trackName: string) → any
The arena alone, at `o`: ground, the racingKit track (road, kerbs, wall colliders, gates, grid), the scenery and the winners' stand. Returns { root, track, data, scenery, stand }.
| arg | type | description |
|---|---|---|
| arenaId | string | |
| t | any | |
| o | any | |
| trackName | string |
clearLeftovers(ctx: any) → void
What an earlier run of the round left behind when it ended without its stop (a show restarted or a host that left mid-race): karts, the race and the arena. Without this a second run races two karts per contestant and the standings list everyone twice.
| arg | type | description |
|---|---|---|
| ctx | any |
sweep(name: string, mineOnly: boolean) → void
| arg | type | description |
|---|---|---|
| name | string | |
| mineOnly | boolean |
hideDrivingHud( ) → void
vehiclesKit's driving HUD (speedometer, BOOST bar, key prompts) is off from the moment the player is seated (during the show's title card and countdown) until GO, so nothing sits over the card. The settings the game had are kept and given back at stop.
hintsPlace(W: number, H: number, controls: { any }?) → void
The key prompts' box on a W x H canvas at vehiclesKit's own scale: one row (maxWidth keeps the five prompts on it), in the bottom-left corner, raised above any on-screen control stated there (ui.safeArea().controls: touch buttons, a game's panels). The top-left belongs to the show's running scores.
| arg | type | description |
|---|---|---|
| W | number | |
| H | number | |
| controls | { any }? |
timerBand(W: number, sa: any?) → any
The show's timer chip band at the top middle of a W-wide screen: partyShowKit draws it 8 points from the top, centred, about 64 points tall (56 on a screen under 700 wide). `{ x, y, width, height }`.
| arg | type | description |
|---|---|---|
| W | number | |
| sa | any? |
touchButtonRects(controls: { any }?) → void
The touch overlay's buttons as rects (centre and radius in camera points), only while the touch controls show (the engine states them in `controls` as "zin_touch_controls"; with a mouse the layout still lists them).
| arg | type | description |
|---|---|---|
| controls | { any }? |
onTouch( ) → boolean
gaugePlace(W: number, H: number, sa: any?, obstacles: { any }) → any
Where the speedometer goes on a W x H touch screen: `{ x, y, width, height, size }` in camera points (size is vehiclesKit's `gaugeSize`), at the top middle under the show's timer when that is free, else the nearest free spot (down first, then sideways), at a smaller size when no spot fits; nil when nothing fits. `sa` is ui.safeArea(), `obstacles` every rect it must keep clear of (controls, touch buttons, the show's scores, racingKit's position block); rects owned by R.HUD_OWNER are the round's own and left out.
| arg | type | description |
|---|---|---|
| W | number | |
| H | number | |
| sa | any? | |
| obstacles | { any } |
free(x: number, y: number) → boolean
| arg | type | description |
|---|---|---|
| x | number | |
| y | number |
hudObstacles(ctx: any?) → void
What the gauge keeps clear of on this machine's screen right now.
| arg | type | description |
|---|---|---|
| ctx | any? |
gaugeSettings(ctx: any?) → any
Places the gauge (touch only: elsewhere vehiclesKit's own bottom-right place stands) and states the timer band and the gauge as control regions. Answers the vehiclesKit settings for the gauge's place, or {}.
| arg | type | description |
|---|---|---|
| ctx | any? |
clearHudRegions( ) → void
showDrivingHud(ctx: any?) → void
At GO: the speedometer and boost bar come back as the game had them, and the key prompts sit bottom left.
| arg | type | description |
|---|---|---|
| ctx | any? |
keepGaugeClear(ctx: any, dt: number) → void
While driving: the touch buttons change (a resize, the overlay turning on with the first touch), so the gauge is placed again twice a second and vehiclesKit is told only when its place changed.
| arg | type | description |
|---|---|---|
| ctx | any | |
| dt | number |
build(ctx: any) → any
| arg | type | description |
|---|---|---|
| ctx | any |
showcase(arenaId: string, origin: any, tuningId: string?) → any
Build arena `arenaId` at `origin` in tuning `tuningId` (default standard) with no race and no karts: for a gallery, a menu backdrop or a screenshot. Returns the root entity; despawn it (and call Scenery.clear on .scenery) to remove it.
| arg | type | description |
|---|---|---|
| arenaId | string | |
| origin | any | |
| tuningId | string? |
start(ctx: any) → void
| arg | type | description |
|---|---|---|
| ctx | any |
myKart(ctx: any) → any
| arg | type | description |
|---|---|---|
| ctx | any |
racerOf(k: any) → any
| arg | type | description |
|---|---|---|
| k | any |
driveOwnedKarts(ctx: any, dt: number) → void
the owner of a kart caps its top speed for the tuning and gives it boost-pad kicks
| arg | type | description |
|---|---|---|
| ctx | any | |
| dt | number |
spectate(ctx: any) → void
after the line: out of the kart, onto the winners' stand, and the camera follows whoever leads the rest
| arg | type | description |
|---|---|---|
| ctx | any |
poseRiders(ctx: any) → void
every machine: a parked bot's visual body holds the seated pose. After a host takeover the new host builds a new visual body for each bot, so the pose follows c.visualBody and the old body is let go.
| arg | type | description |
|---|---|---|
| ctx | any |
botOut(ctx: any, c: any) → void
Host: a finished bot climbs out of its kart onto the winners' stand, and the empty kart leaves the track.
| arg | type | description |
|---|---|---|
| ctx | any | |
| c | any |
update(ctx: any, dt: number) → void
| arg | type | description |
|---|---|---|
| ctx | any | |
| dt | number |
botThink(ctx: any, c: any, dt: number) → void
| arg | type | description |
|---|---|---|
| ctx | any | |
| c | any | |
| dt | number |
stopStep(name: string, fn: () → void
One step of stop. Each runs on its own and a failure is logged with its name, so one step that fails (a kit that did not load, a camera already gone) never leaves the karts on the track, a player in a seat or vehiclesKit's speedometer, boost bar and key prompts on screen in the next round or the lobby.
| arg | type | description |
|---|---|---|
| name | string | |
| fn | ( |
stop(ctx: any) → void
| arg | type | description |
|---|---|---|
| ctx | any |
rosterId(c: any, slot: number) → number
The id racingKit's race knows contestant `c` in grid slot `slot` by: a person's peer id, a bot's negative slot.
| arg | type | description |
|---|---|---|
| c | any | |
| slot | number |
seatOffset(v: any, body: any) → void
Where a contestant's feet go so their hips sit on vehicle `v`'s driver seat, in the vehicle's own axes (the `seat` the round hands Showrunner's ctx.setVehicle). `body` is the visual body (its hip height is measured).
| arg | type | description |
|---|---|---|
| v | any | |
| body | any |
state( ) → any
Internal state of this machine's round (tests and tools).
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
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.