diff --git a/public/src/games/monopoly/MonopolyGame.js b/public/src/games/monopoly/MonopolyGame.js index 58a823a..a8f43a0 100644 --- a/public/src/games/monopoly/MonopolyGame.js +++ b/public/src/games/monopoly/MonopolyGame.js @@ -1191,6 +1191,7 @@ export default class MonopolyGame extends Phaser.Scene { const hopOne = () => { if (step >= steps) { resolve(); return; } step++; + const fromSpace = cur; cur = (cur + 1) % 40; const start = { x: pawn.x, y: pawn.y }; @@ -1204,10 +1205,13 @@ export default class MonopolyGame extends Phaser.Scene { const dx = BOARD_CX - mx; const dy = BOARD_CY - my; const dist = Math.hypot(dx, dy); - const nx = dist > 0 ? dx / dist : 0; - const ny = dist > 0 ? dy / dist : -1; + let nx = dist > 0 ? dx / dist : 0; + let ny = dist > 0 ? dy / dist : -1; - // Quadratic Bézier control point: ARCH_H px toward board center from midpoint + // Top row (spaces 20–29): arch away from center so the piece hops outward + if (fromSpace >= 20 && fromSpace <= 29) { nx = -nx; ny = -ny; } + + // Quadratic Bézier control point: ARCH_H px toward/away from board center const ctrl = { x: mx + nx * ARCH_H, y: my + ny * ARCH_H }; const proxy = { t: 0 };