Compare commits
No commits in common. "0c416f362b3159eff7aa19c83cfaaddc44b1079f" and "676a4d31060eee8a0d1a834123b344cc8e8b61f0" have entirely different histories.
0c416f362b
...
676a4d3106
Binary file not shown.
|
|
@ -43,9 +43,8 @@ const DEPTH = {
|
|||
};
|
||||
|
||||
// ── Layout ───────────────────────────────────────────────────────────────────
|
||||
const PANEL_TOP = 200; // top of each trace panel frame
|
||||
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 PANEL_TOP = 200; // top of each trace panel frame
|
||||
const SECRET_Y = PANEL_TOP + 50; // secret-code row inside the panel header
|
||||
const ROWS_TOP = PANEL_TOP + 100; // first guess row
|
||||
const ROW_H = 46;
|
||||
const PEG_R = 16;
|
||||
|
|
@ -88,7 +87,7 @@ export default class MastermindGame extends Phaser.Scene {
|
|||
this.rightLayer = this.add.container(0, 0).setDepth(DEPTH.rows);
|
||||
this.composeLayer = this.add.container(0, 0).setDepth(DEPTH.compose);
|
||||
|
||||
new Button(this, GAME_WIDTH - 120, GAME_HEIGHT - 60, 'Leave', () => this.scene.start('GameMenu'), {
|
||||
new Button(this, GAME_WIDTH - 120, 60, 'Leave', () => this.scene.start('GameMenu'), {
|
||||
variant: 'ghost', width: 160, height: 46, fontSize: 20,
|
||||
}).setDepth(DEPTH.ui);
|
||||
|
||||
|
|
@ -207,7 +206,7 @@ export default class MastermindGame extends Phaser.Scene {
|
|||
'user-select:none',
|
||||
].join(';');
|
||||
this._turnArrowEl = el;
|
||||
this.turnArrow = this.add.dom(GAME_WIDTH / 2, TURN_ARROW_Y, el).setVisible(false);
|
||||
this.turnArrow = this.add.dom(GAME_WIDTH / 2, SECRET_Y, el).setVisible(false);
|
||||
}
|
||||
|
||||
// Point the arrow toward the active panel and pulse it back and forth that way.
|
||||
|
|
@ -217,7 +216,7 @@ export default class MastermindGame extends Phaser.Scene {
|
|||
const baseX = GAME_WIDTH / 2;
|
||||
const left = side === 'player';
|
||||
this._turnArrowEl.textContent = left ? '◀' : '▶';
|
||||
this.turnArrow.setVisible(true).setPosition(baseX, TURN_ARROW_Y).setScale(1);
|
||||
this.turnArrow.setVisible(true).setPosition(baseX, SECRET_Y).setScale(1);
|
||||
this._turnTween = this.tweens.add({
|
||||
targets: this.turnArrow,
|
||||
x: baseX + (left ? -22 : 22),
|
||||
|
|
@ -596,14 +595,10 @@ export default class MastermindGame extends Phaser.Scene {
|
|||
this.fxLayer.add(peg);
|
||||
pegsObjs.push(peg);
|
||||
}
|
||||
// 2.3 seconds total: 32 ticks at ~72ms each
|
||||
const totalDuration = 2300;
|
||||
const tickInterval = totalDuration / 32;
|
||||
playSound(this, SFX.MASTERMIND_CALCULATE);
|
||||
let ticks = 0;
|
||||
const maxTicks = 32;
|
||||
const maxTicks = 9;
|
||||
const ev = this.time.addEvent({
|
||||
delay: tickInterval, repeat: maxTicks,
|
||||
delay: 70, repeat: maxTicks,
|
||||
callback: () => {
|
||||
ticks++;
|
||||
pegsObjs.forEach((p, c) => {
|
||||
|
|
|
|||
|
|
@ -69,7 +69,6 @@ export default class PreloadScene extends Phaser.Scene {
|
|||
this.load.audio('sfx-mastermind-access-denied', '/assets/fx/mastermind-access-denied.mp3');
|
||||
this.load.audio('sfx-mastermind-color', '/assets/fx/mastermind-color.mp3');
|
||||
this.load.audio('sfx-mastermind-match', '/assets/fx/mastermind-match.mp3');
|
||||
this.load.audio('sfx-mastermind-calculate', '/assets/fx/mastermind-calculate.mp3');
|
||||
this.load.audio('sfx-roulette', '/assets/fx/roulette.mp3');
|
||||
this.load.audio('sfx-battleship-hit', '/assets/fx/battleship-hit.mp3');
|
||||
this.load.audio('sfx-battleship-miss', '/assets/fx/battleship-miss.mp3');
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@ export const SFX = {
|
|||
MASTERMIND_GRANTED: 'sfx-mastermind-access-granted',
|
||||
MASTERMIND_DENIED: 'sfx-mastermind-access-denied',
|
||||
MASTERMIND_COLOR: 'sfx-mastermind-color',
|
||||
MASTERMIND_MATCH: 'sfx-mastermind-match',
|
||||
MASTERMIND_CALCULATE: 'sfx-mastermind-calculate',
|
||||
MASTERMIND_MATCH: 'sfx-mastermind-match',
|
||||
};
|
||||
|
||||
export function playSound(scene, key) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue