Background and playfield changes

This commit is contained in:
Brian Fertig 2026-06-02 14:30:13 -06:00
parent 2f7b2e183e
commit 04a32cebcd
1 changed files with 7 additions and 2 deletions

View File

@ -53,7 +53,12 @@ export default class BlokusGame extends Phaser.Scene {
const playerCount = 1 + this.opponents.length;
this.gs = createInitialState({ playerCount });
this.add.rectangle(GAME_WIDTH / 2, GAME_HEIGHT / 2, GAME_WIDTH, GAME_HEIGHT, 0x10130f).setDepth(DEPTH.felt);
if (this.playfield?.key && this.textures.exists(this.playfield.key)) {
this.add.image(GAME_WIDTH / 2, GAME_HEIGHT / 2, this.playfield.key)
.setDisplaySize(GAME_WIDTH, GAME_HEIGHT).setDepth(DEPTH.felt);
} else {
this.add.rectangle(GAME_WIDTH / 2, GAME_HEIGHT / 2, GAME_WIDTH, GAME_HEIGHT, 0xffffff).setDepth(DEPTH.felt);
}
this.buildBoard();
this.pieceGfx = this.add.graphics().setDepth(DEPTH.piece);
@ -77,7 +82,7 @@ export default class BlokusGame extends Phaser.Scene {
// ── Static board ────────────────────────────────────────────────────────────
buildBoard() {
const g = this.add.graphics().setDepth(DEPTH.grid);
g.fillStyle(0x1b1e17, 1);
g.fillStyle(0xffffff, 1);
g.fillRect(GRID_X, GRID_Y, BOARD_PX, BOARD_PX);
g.lineStyle(1, 0x3a3f33, 0.8);
for (let i = 0; i <= SIZE; i++) {