Turn arrow placement

This commit is contained in:
Brian Fertig 2026-05-31 10:01:18 -06:00
parent 676a4d3106
commit 13b9d0d1cc
1 changed files with 5 additions and 4 deletions

View File

@ -43,8 +43,9 @@ const DEPTH = {
}; };
// ── Layout ─────────────────────────────────────────────────────────────────── // ── Layout ───────────────────────────────────────────────────────────────────
const PANEL_TOP = 200; // top of each trace panel frame const PANEL_TOP = 200; // top of each trace panel frame
const SECRET_Y = PANEL_TOP + 50; // secret-code row inside the panel header const SECRET_Y = PANEL_TOP + 50; // secret-code row inside the panel header
const TURN_ARROW_Y = SECRET_Y + 300; // yellow turn-indicator arrow
const ROWS_TOP = PANEL_TOP + 100; // first guess row const ROWS_TOP = PANEL_TOP + 100; // first guess row
const ROW_H = 46; const ROW_H = 46;
const PEG_R = 16; const PEG_R = 16;
@ -206,7 +207,7 @@ export default class MastermindGame extends Phaser.Scene {
'user-select:none', 'user-select:none',
].join(';'); ].join(';');
this._turnArrowEl = el; this._turnArrowEl = el;
this.turnArrow = this.add.dom(GAME_WIDTH / 2, SECRET_Y, el).setVisible(false); this.turnArrow = this.add.dom(GAME_WIDTH / 2, TURN_ARROW_Y, el).setVisible(false);
} }
// Point the arrow toward the active panel and pulse it back and forth that way. // Point the arrow toward the active panel and pulse it back and forth that way.
@ -216,7 +217,7 @@ export default class MastermindGame extends Phaser.Scene {
const baseX = GAME_WIDTH / 2; const baseX = GAME_WIDTH / 2;
const left = side === 'player'; const left = side === 'player';
this._turnArrowEl.textContent = left ? '◀' : '▶'; this._turnArrowEl.textContent = left ? '◀' : '▶';
this.turnArrow.setVisible(true).setPosition(baseX, SECRET_Y).setScale(1); this.turnArrow.setVisible(true).setPosition(baseX, TURN_ARROW_Y).setScale(1);
this._turnTween = this.tweens.add({ this._turnTween = this.tweens.add({
targets: this.turnArrow, targets: this.turnArrow,
x: baseX + (left ? -22 : 22), x: baseX + (left ? -22 : 22),