feat: add drivable black luxury cars, Apache motorcycles and lane splitting
CI/CD / test (push) Successful in 57s
CI/CD / publish (push) Successful in 59s
CI/CD / deploy (push) Successful in 6s

- Park black BMW, Lamborghini, Mazda and Nissan style cars in the factory
  yard; Mr Mohammadi now arrives in a Bugatti that becomes drivable once
  parked; the delivery truck is black.
- Add six Apache style motorcycles with a rider, lean and their own
  handling (BIKE spec, 130 km/h).
- Let the player take any traffic car; a garage module owns every
  drivable vehicle and resets them.
- Replace the 3.4 m circle test between vehicles with oriented boxes
  sized from each model, so contact only happens when bodies touch and
  bikes can filter between cars; traffic only brakes for its own lane.
- Add tests for box collisions, bike handling, traffic lane checks and
  taking traffic cars.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 09:33:19 +03:30
co-authored by Claude Opus 5.5
parent 526796126d
commit e02347142b
18 changed files with 1352 additions and 336 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ import { addPolygon, resolveCircle } from '../world/collision.js';
import { createState } from '../economy/gameState.js';
import { createPayment } from '../economy/payment.js';
import { createVendingMachine } from '../models/vending.js';
import { resetGarage } from './garage.js';
/**
* Runs the place station operation for this subsystem.
* @param {*} context - context.
@@ -78,9 +79,9 @@ export function reset(context) {
speed: 0,
gait: 0,
};
resetGarage(context);
context.factory.reset();
for (const t of context.factory.talks) t.done = false;
context.car = context.spawnCar();
context.mode = 'walk';
// Camera yaw: the camera sits at target + (sin yaw, cos yaw) * distance, so it looks along (-sin, -cos).
context.cam = {