diff --git a/public/src/games/minimotorways/MiniMotorwaysGame.js b/public/src/games/minimotorways/MiniMotorwaysGame.js index 318bd44..a1724ab 100644 --- a/public/src/games/minimotorways/MiniMotorwaysGame.js +++ b/public/src/games/minimotorways/MiniMotorwaysGame.js @@ -1096,7 +1096,7 @@ export default class MiniMotorwaysGame extends Phaser.Scene { const y = rr.py + (rr.cy - rr.py) * alpha + Math.sin(time * 0.011 + car.id) * 0.8; // Offset to the right side of the road (perpendicular to heading, right side) const rightOffset = CELL * 0.12; - const rightAngle = rec.rot + Math.PI / 2; + const rightAngle = rec.rot - Math.PI / 2; rec.c.setPosition(x + rightOffset * Math.cos(rightAngle), y + rightOffset * Math.sin(rightAngle)); rec.c.setVisible(true); rec.c.setDepth(car.mw ? D.motorway + 0.5 : D.cars); diff --git a/public/src/games/minimotorways/MiniMotorwaysLogic.js b/public/src/games/minimotorways/MiniMotorwaysLogic.js index b68ff04..ca51aee 100644 --- a/public/src/games/minimotorways/MiniMotorwaysLogic.js +++ b/public/src/games/minimotorways/MiniMotorwaysLogic.js @@ -23,8 +23,8 @@ export const TUNE = { HEADWAY: 0.65, // minimum gap behind the car ahead, in cells DWELL_MS: 1000, COOLDOWN_MS: 2000, - PIN_MS_BASE: 18000, // pin interval = max(MIN, BASE * DECAY^week) - PIN_MS_DECAY: 0.94, + PIN_MS_BASE: 12000, // pin interval = max(MIN, BASE * DECAY^week) + PIN_MS_DECAY: 0.90, PIN_MS_MIN: 3500, PIN_GRACE_MS: 15000, // new buildings wait this long before pin #1 PIN_CAP: 12, @@ -1010,13 +1010,10 @@ export class Sim { const front = ddx * hx + ddy * hy; if (front <= 0.05) continue; const lat = Math.abs(-ddx * hy + ddy * hx); - if (lat > 0.45) continue; - if (other.state !== 'dwell') { - // Opposite-direction cars pass through each other — this is what keeps - // a single road usable both ways without lane simulation. - const dot = hx * Math.cos(other.heading) + hy * Math.sin(other.heading); - if (dot < 0.3) continue; - } + // Opposite-direction cars pass freely regardless of lateral distance. + // Same-direction cars must be laterally separated enough to pass. + const dot = hx * Math.cos(other.heading) + hy * Math.sin(other.heading); + if (dot < 0.3 || lat > 0.6) continue; allowed = Math.min(allowed, front - TUNE.HEADWAY); } return Math.max(0, allowed);