Background and playfield changes
This commit is contained in:
parent
2f7b2e183e
commit
04a32cebcd
|
|
@ -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++) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue