Log inGet started
Package

RaceGame.component

Newest version

README.md

RaceGame

The Voxel Raceway race manager. Attach it to a single host entity (the main scene declares voxelraceway_host). It builds a closed stadium racetrack — asphalt ribbon, red/white curbs, side barriers, a grass runoff, an emissive start/finish gate and eight ordered checkpoints — plus the karts (player + AI rivals), then runs the whole race in play mode.

Fields

  • laps (default 3) — laps required to finish.
  • racers (default 4) — total karts (1 player + up to 3 AI), clamped to the roster.

How it works

  • Kinematic arcade karts. A scalar throttle speed is projected onto the kart heading and integrated into a world-velocity vector with a lateral-grip blend, so karts ease through corners and tilt (roll) into turns. No rigid bodies — handling is predictable and the AI stays competitive.
  • AI steers toward a look-ahead waypoint on the centreline and eases the throttle in tight corners.
  • Ordered checkpoints. Each kart must pass the eight checkpoints in order; crossing the start/finish line after a full ordered loop counts a lap. First to laps wins.
  • Countdown. A 3-2-1-GO countdown locks all input until GO.
  • HUD (zui): lap, position, race time, speed, boost meter, the centred countdown, and a finish banner; a live standings list top-right.
  • Camera. Wires the ChaseCamera component onto the active camera at a high execution order so it trails the player kart and widens FOV under boost.

Input (the vehicle zinput context): W/↑ throttle, S/↓ brake/reverse, A/D steer, Space drift, Shift boost.