Log inGet started
World

Torque Valley: Driving, Drift and Crash Sandbox

README.md

gaugeClusters

Checks the gauge package without putting anything on screen:

  • Styles: ten styles in gallery order (styles.ids() and gauges.styles() agree), each with a build and a size. An unknown id falls back to analog.
  • Reader: gearLabel (R / N / gear / "-"). read() returns every field from hand-written car.* values, km/h is derived from car.speed alone, the redline defaults to 87 % of the limiter, and a missing car reads ok = false. Also covered: isCar, writesValues and resolve of an explicit car.
  • FakeCar: the simulation the FakeCar component runs drives up through the gears, and the reader reads exactly what it wrote. The component starts at rest and exposes state().
  • View maths: km/h vs mph, the style's top speed (260 km/h, 160 mph, truck 140) unless maxSpeed is set, the rev scale rounded up to the next thousand and the redline fraction.
  • Every style draws: Gauges.frame builds a full-screen tree with the cluster node for every style, both with a car and without one.
  • GaugeCluster component: setStyle accepts all ten and refuses an unknown one. reading() follows the style and reads the target car, cycleStyle wraps round, and target() is the car.

It leaves alone what the clusters look like on screen and the per-frame screen registration, which runs only in play (judge those with the gallery scene and a capture), as well as following the local player's car. Entities are spawned far below the play area and despawned after each test. The cluster under test has visible = false.

Run it in edit mode:

return asset.resolve("gaugeClusters", "testSuite"):run()