← all kitsgenre kit

racing

tracks, ghosts, garages

Top-down arcade racing (portrait or landscape): tile tracks with a racing line, kinematic car physics (grip/drift, brakes, nitro, boost pads, oil, ramps, off-road, wall bounces, car bumps), ordered checkpoints with shortcut detection, lap/split/best timing, positions, AI racers with difficulty presets + bounded rubber-banding, items, race modes (race, cup, time trial with ghost, elimination), garage (cars, unlocks, upgrades on core.wallet), HUD + mini-map + countdown + podium, and headless balance sims. Requires core, progression, juice, ai (auto-enabled via kit.json). Example: games/examples/kit-racing (Sprout Speedway: 1 cup × 3 tracks, 4 cars, time trial with ghost, garage).

Setup

kits = ["racing"]          # core, progression, juice, ai come with it
orientation = "portrait"
local Racing = require("@kit/racing")
local C = Racing.content.load()          -- data/racing.json + data/tracks|cars|cups/*.json (engine data.read; id = file name)
-- race scene script: ONE call builds the whole race
Racing.view.race({
  track = C.tracks.pea_patch, tileset = "data/tilesets/garden.json",
  player = { sprite = "asset:car_red", stats = garage:stats() },
  rivals = { { id = "moss", name = "Moss", sprite = "asset:car_green", stats = Racing.car.stats(C.cars.snap_pea), preset = "normal" } },
  mode = "race", laps = 3, music = "race",
  buttons = { { "AGAIN", function() loadScene("scenes/race.scene.json") end } },   -- default podium; or onFinish(results, h)
})

Coordinates: world px, y down. Heading a radians, 0 = up, clockwise; forward = (sin a, −cos a). Draw car art facing up (sprite rotation = deg(a)). Default car sprite size 34×54 on 64 px tiles (road = 3 tiles wide).

Example game

Sprout Speedway running on the Dreamsy engine

Sprout Speedway

Toy cars race through a backyard garden. Beat your own ghost in time trials.

racingtop-down

Full reference on GitHub