race
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
race
<!-- 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/v2game.race — las reglas de una carrera. Aquí está lo que decide una carrera, sin tocar el motor: por dónde va un kart en la vuelta, cuándo ha cruzado la meta, cuándo se ha salido tanto que Lakitu tiene que ir a por él, y en qué orden van. Las reglas viven aparte de la entidad que las aplica para que se puedan comprobar sin conducir.
gateArcs(length: ?, gates: ?) → void
Los puntos de la vuelta donde están las puertas, por longitud de arco.
| arg | type | description |
|---|---|---|
| length | ? | |
| gates | ? |
crossed(prev: ?, now: ?, target: ?, length: ?) → void
¿Se ha cruzado `target` yendo de `prev` a `now`, dando vueltas a una pista de longitud `length`? Tiene en cuenta el salto de la meta.
| arg | type | description |
|---|---|---|
| prev | ? | |
| now | ? | |
| target | ? | |
| length | ? |
forwardDelta(prev: ?, now: ?, length: ?) → void
Cuánto se ha avanzado de `prev` a `now`, en el sentido de la marcha. Ir hacia atrás cuenta como negativo, y el salto de la meta como el paso corto que es. Es lo que distingue "he cruzado la meta" de "he ido hacia atrás": sin esto, ir y venir por la línea contaba vueltas.
| arg | type | description |
|---|---|---|
| prev | ? | |
| now | ? | |
| length | ? |
newEntry(kartId: ?) → void
El estado de un kart dentro de una carrera. `travelled` es un odómetro: los metros que lleva recorridos desde la salida, en el sentido de la marcha. Sube al avanzar y baja al retroceder, así que una vuelta no se puede falsear yendo y viniendo.
| arg | type | description |
|---|---|---|
| kartId | ? |
advanceGates(entry: ?, arc: ?, length: ?, gates: ?) → void
Avanza el odómetro y las puertas. Devuelve cuántas vueltas se han completado en este paso (normalmente 0, y 1 al cruzar la meta).
| arg | type | description |
|---|---|---|
| entry | ? | |
| arc | ? | |
| length | ? | |
| gates | ? |
onRescue(entry: ?, arc: ?) → void
Un kart rescatado por Lakitu vuelve a la pista en la última puerta que pasó: el odómetro se recoloca ahí, no donde estaba perdido.
| arg | type | description |
|---|---|---|
| entry | ? | |
| arc | ? |
shouldRescue(entry: ?, distanceFromTrack: ?, dt: ?) → void
Si esta entrada se ha perdido y hay que ir a buscarla. Devuelve true la primera vez que se cumple el tiempo de espera.
| arg | type | description |
|---|---|---|
| entry | ? | |
| distanceFromTrack | ? | |
| dt | ? |
rescueArc(entry: ?, inst: ?) → void
El sitio donde hay que dejar a un kart rescatado: la muestra más cercana a la última puerta que pasó.
| arg | type | description |
|---|---|---|
| entry | ? | |
| inst | ? |
rescueIndex(entry: ?, inst: ?) → void
| arg | type | description |
|---|---|---|
| entry | ? | |
| inst | ? |
countdownFor( ) → void
Los segundos que quedan de cada cilindrada, en la cuenta atrás.
formatTime(sec: ?) → void
"1:23.456"
| arg | type | description |
|---|---|---|
| sec | ? |
formatShort(sec: ?) → void
"1:23.4" para los tiempos que se leen de un vistazo.
| arg | type | description |
|---|---|---|
| sec | ? |
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.