Torque Valley: Driving, Drift and Crash Sandbox
README.md
DriverProgress
Gives a driver XP, levels and challenges. Put it on any entity (an empty one is fine; it needs no
sibling components). Each frame in play it reads a car — the car field, or the local player's own
car when empty — through driveProgress.reader, scores top speed, chained drifts, air time, crashes
and distance with driveProgress.score under its style (arcade, career, stunt, drift, zen; switch
live, XP kept), writes driver.xp, driver.level, driver.levelFrac, driver.combo,
driver.drift, driver.air and driver.distance values, announces awards, level-ups and
challenges as navUiKit toasts and personal objectives, and keeps a barsKit XP bar (and a
body-damage bar from car.damage) on screen. navUiKit and barsKit are optional.
Methods: progress(), reset(), setStyle(id), addChallenge(def), removeChallenge(id),
completeChallenge(id), challenges(), bonus(xp, why?), feed(sample, dt) (score a sample by
hand; with manual = true it reads no car), recent() (the last events), target().