tracks
The three circuits of Mario Kart OrigoZ, built from code on every scene load — nothing is frozen into the scene, so a reload lands in the same world.
tracks
The three circuits of Mario Kart OrigoZ, built from code on every scene load — nothing is frozen into the scene, so a reload lands in the same world.
require("game.tracks"), then Core.system("tracks").
The circuits
| id | Circuit | Laps | What it is |
|---|---|---|---|
cheep | Playa Cheep Cheep | 4 | A wobbly sand ring floating in turquoise water, with posts down both edges, twenty-two Cheep Cheep (some swimming, some leaping), palm islands in the shallows and a start gantry. |
mumu | Pradera Mu Mu | 3 | A big square dirt route over a grass meadow — a wandering path with rounded corners, a shortcut cutting straight across the middle, fences, hills, fourteen cows (one in a sombrero) and two turning windmills. |
arcoiris | Senda Arcoiris | 4 points | One long point-to-point rainbow ribbon through black space, never revisited: Earth huge and far off down the course, stars, clouds floating beside the road, three chained balls patrolling the last stretch, and a finish gantry ringed with heart-shaped clouds. |
Only one circuit is in the world at a time; select clears every circuit
tree — by name, so a hot reload of this file cannot orphan one — and builds
the one you asked for.
API
| Call | Contract |
|---|---|
T.select(id) | Build and show that circuit, set its environment (sun, ambient, sky, Earth, sea, meadow), take the others down. Idempotent: selecting what is already up does nothing. |
T.active() | The active circuit's record from Core.CIRCUITS. |
T.activeCircuit() | The internal record: ribs, reach, gates, origin, closed, laps. |
T.startPose(id?) | { pos = {x,y,z}, yaw = radians } — on the line, facing down the course. |
T.surfaceAt(pos) | "road" / "water" / "grass" / "space". On a loop, off the ribbon is the circuit's out surface; on the ribbon it is space. |
T.heightAt(pos) | Y of the racing surface, or nil when there is none within reach. |
T.progressAt(pos) | { u = 0..1, lateral, onTrack, width, y, rise }. u is the distance round the racing line; rise is the local slope, and rampAt is ` |
T.rampAt(pos) | True where the path climbs hard enough to launch off. |
T.nearest(pos) | { pos, yaw } — the nearest drivable point, high enough to drop back onto. Lakitu's target. |
T.crossed(prev, cur) | The gate a move crossed this frame — stateless, so many karts can share it. |
T.advance(prev, cur) | Crossed a gate and advanced the race: calls Core.reachPoint, which banks the lap or finishes the circuit. Returns { crossed, point, finished }. The kart owns the previous position; this owns the meaning. |
T.crates(id) | The ? crate spots for the circuit, in lap order — 5 rows of 4 on a loop, 8 rows of 4 on the ribbon. |
Environment
sun, ambient and sky belong to the scene and the tracks set them per
circuit; what each circuit owns (the sea, the meadow, the Earth) is spawned
by this module.
Fields that are stand-ins for polish
Cow, CowSombrero, CheepCheep, ChainChomp, Earth, Windmill, Palm
and HeartCloud are blockouts. Each is a named entity at the right place,
size and scale, waiting for a generated model at the same transform.
Scoped to this part · feeds back into the world's score.