fix: ensure modal buttons render above overlay and add Yatzi playfield background
This commit is contained in:
parent
366a6b095b
commit
e171be7c10
|
|
@ -975,6 +975,7 @@ export default class BlackjackGame extends Phaser.Scene {
|
|||
this.gs = applyInsurance(this.gs, 0, true);
|
||||
this.checkImmediateDealerBJ();
|
||||
}, { width: 120, height: 52, fontSize: 20 });
|
||||
yesBtn.setDepth(D.modal + 1);
|
||||
|
||||
const noBtn = new Button(this, CX + 120, GAME_HEIGHT / 2 + 30, 'No', () => {
|
||||
modal.destroy();
|
||||
|
|
@ -982,6 +983,7 @@ export default class BlackjackGame extends Phaser.Scene {
|
|||
this.gs = applyInsurance(this.gs, 0, false);
|
||||
this.checkImmediateDealerBJ();
|
||||
}, { width: 120, height: 52, fontSize: 20, variant: 'ghost' });
|
||||
noBtn.setDepth(D.modal + 1);
|
||||
}
|
||||
|
||||
checkImmediateDealerBJ() {
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ export default class YatziGame extends Phaser.Scene {
|
|||
async create() {
|
||||
new MusicPlayer(this, this.cache.json.get('music').tracks);
|
||||
this.add.rectangle(GAME_WIDTH / 2, GAME_HEIGHT / 2, GAME_WIDTH, GAME_HEIGHT, COLORS.bg).setDepth(DEPTH.bg);
|
||||
this.buildPlayfield();
|
||||
|
||||
// Compose players: human first, then AI opponents
|
||||
const playerNames = [
|
||||
|
|
@ -122,6 +123,16 @@ export default class YatziGame extends Phaser.Scene {
|
|||
this.time.delayedCall(450, () => this.nextTurn());
|
||||
}
|
||||
|
||||
// ─── Playfield background ──────────────────────────────────────────────
|
||||
buildPlayfield() {
|
||||
const pf = this.playfield;
|
||||
if (pf?.key && this.textures.exists(pf.key)) {
|
||||
this.add.image(GAME_WIDTH / 2, GAME_HEIGHT / 2, pf.key)
|
||||
.setDisplaySize(GAME_WIDTH, GAME_HEIGHT)
|
||||
.setDepth(DEPTH.bg + 1);
|
||||
}
|
||||
}
|
||||
|
||||
// ─── Left panel (title + status) ──────────────────────────────────────
|
||||
buildLeftPanel() {
|
||||
this.add.text(LEFT_CX, 56, 'Yatzi', {
|
||||
|
|
|
|||
Loading…
Reference in New Issue