From 810c94da21c6fa205d828ae83724adb8f39dfa54 Mon Sep 17 00:00:00 2001 From: Brian Fertig Date: Fri, 12 Jun 2026 16:06:10 -0600 Subject: [PATCH] fix: adjust car size and positioning on roads - Scale down car sprites to 70% size for better visual fit - Offset cars to the right side of roads using perpendicular positioning instead of centering them on the road path --- public/src/games/minimotorways/MiniMotorwaysGame.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/src/games/minimotorways/MiniMotorwaysGame.js b/public/src/games/minimotorways/MiniMotorwaysGame.js index d267711..318bd44 100644 --- a/public/src/games/minimotorways/MiniMotorwaysGame.js +++ b/public/src/games/minimotorways/MiniMotorwaysGame.js @@ -606,7 +606,7 @@ export default class MiniMotorwaysGame extends Phaser.Scene { ensureCarSprite(car) { let rec = this.carSprites.get(car.id); if (!rec) { - const c = this.add.container(0, 0).setDepth(D.cars); + const c = this.add.container(0, 0).setDepth(D.cars).setScale(0.7); const img = this.add.image(0, 0, `mm-car-${car.color}`); const pin = this.add.image(0, -12, 'mm-pin').setTint(COLOR_HEX[car.color]).setScale(0.8).setVisible(false); c.add([img, pin]); @@ -1094,7 +1094,10 @@ export default class MiniMotorwaysGame extends Phaser.Scene { if (!rr) continue; const x = rr.px + (rr.cx - rr.px) * alpha; const y = rr.py + (rr.cy - rr.py) * alpha + Math.sin(time * 0.011 + car.id) * 0.8; - rec.c.setPosition(x, y); + // 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; + 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); let target = car.heading;