CarTrack
A fun game made with perfection — with plans for a 3D Asphalt-style arcade racer and a scored engine comparison.
A fun game made with perfection.
A fun game made with perfection — with plans for a 3D Asphalt-style arcade racer and a scored engine comparison.
A fun game made with perfection.
A 3D arcade street racer in the spirit of Asphalt. One TypeScript codebase, targeting Windows, Linux, macOS, iOS and Android.
Current state: playable vertical slice — one car, one circuit, three laps, full race timing, nitro, drifting with skid marks, touch and gamepad support.
npm install
npm run dev # dev server on http://localhost:5173
| Command | What it does | |---|---| | npm run dev | Vite dev server, bound to 0.0.0.0 | | npm run build | Typecheck, then production build to dist/ | | npm run preview | Serve the production build | | npm test | Vitest, headless | | npm run typecheck | tsc --noEmit |
Requires Node 20+.
| Action | Keyboard | Gamepad | Touch | |---|---|---|---| | Throttle | W / ↑ | Right trigger or A | GAS | | Brake / reverse | S / ↓ | Left trigger or B | BRAKE | | Steer | A D / ← → | Left stick | ◀ ▶ | | Nitro | Shift | RB | NITRO | | Handbrake / drift | Space | X | DRIFT | | Restart | R | — | button on the finish card |
src/
├── core/ pure TypeScript — no engine imports, fully unit tested
│ ├── car.ts arcade car physics (fixed timestep)
│ ├── track.ts Catmull-Rom centreline, projection, on/off track
│ ├── race.ts lap timing, checkpoints, wrong-way detection
│ ├── fixedStep.ts accumulator so behaviour is framerate independent
│ ├── math.ts vectors, damping, angle helpers
│ └── input.ts shared CarInput shape
├── render/ three.js only — scene, track mesh, car, chase camera, effects
├── platform/ device input collection (keyboard, gamepad, touch)
├── ui/ DOM HUD and on-screen touch controls
└── main.ts game loop
The rule that keeps this maintainable: core/ never imports three.js. That is what makes the physics testable headless and what will let the simulation be ported if the renderer ever changes.
Deliberately not a tyre simulation. Real tyre models fight you on drifts and jumps. Instead: steering lock falls off with speed, yaw comes from a bicycle model, and the world velocity is re-decomposed against the new heading each step — the residual becomes lateral velocity, which grip then decays. That residual is the drift; there is no separate drift term to tune.
41 tests across 4 files, all headless:
car.test.ts — acceleration, top speed, nitro, braking, reversing, drift,off-track grip, determinism, and a regression guard on the steering sign
track.test.ts — spline closure, unit tangents, projection, lateral offsets,spawn alignment, on/off-track classification
race.test.ts — lap detection, halfway checkpoint, anti-cheat on reversingover the line, best lap, finish, time formatting
integration.test.ts — an autopilot drives the full Harbour Circuit andcompletes all three laps through the real track + car + race stack
Jumps and ramps, traffic and rivals, damage, a second car or track, engine audio, save data, and the native shells (Capacitor for iOS/Android, Electron or Tauri for desktop). See docs/PLAN.md for the roadmap and docs/ENGINE_COMPARISON.md for the stack decision.
Proprietary — closed source. All Rights Reserved.
CarTrack is not open source. No rights to use, copy, modify, or distribute the contents of this repository are granted. See LICENSE for details. This repository being publicly visible does not grant any rights to its contents.
A Python-controlled Minecraft player bot — joins a server as a normal player, steered from a web config panel with an Ollama brain, anti-AFK and fleet support.
A web game almost similar to Minecraft and bloxd.io.
A collection of various games, feel free to play — now with its own home at gamez.web.app.