diff --git a/assets/images/worms/background-menu.png b/assets/images/worms/background-menu.png new file mode 100644 index 0000000..74ed169 Binary files /dev/null and b/assets/images/worms/background-menu.png differ diff --git a/src/data/assetManifest.js b/src/data/assetManifest.js index 44bac2c..c370480 100644 --- a/src/data/assetManifest.js +++ b/src/data/assetManifest.js @@ -89,6 +89,7 @@ export const MANIFEST = { // All of Worms' art is optional drop-in theme art; the game is fully // playable with none of it (see data/worms-artwork.json). worms: [ + image('worms-bg-menu', 'assets/images/worms/background-menu.png'), (scene) => wormsArt(scene), ], gootower: [ diff --git a/src/games/worms/WormsGame.js b/src/games/worms/WormsGame.js index 8f9fd51..ca08f3a 100644 --- a/src/games/worms/WormsGame.js +++ b/src/games/worms/WormsGame.js @@ -96,19 +96,21 @@ export default class WormsGame extends Phaser.Scene { showModeSelect() { this.clearScreen(); this.cameras.main.setScroll(0, 0).setZoom(1).setBounds(0, 0, GAME_WIDTH, GAME_HEIGHT); - this.title('WORMS', 150, 96); - this.track(this.add.text(GAME_WIDTH / 2, 232, 'Total annihilation, one turn at a time.', { - fontFamily: FONT, fontSize: '30px', color: COLORS.mutedHex, - }).setOrigin(0.5).setScrollFactor(0).setDepth(100)); + + // Background image (if loaded). + if (this.textures.exists('worms-bg-menu')) { + this.track(this.add.image(GAME_WIDTH / 2, GAME_HEIGHT / 2, 'worms-bg-menu') + .setDisplaySize(GAME_WIDTH, GAME_HEIGHT).setDepth(-1)); + } MODES.forEach((m, i) => { - this.track(new Button(this, GAME_WIDTH / 2, 400 + i * 96, m.label, () => { + this.track(new Button(this, GAME_WIDTH / 2, 800 + i * 96, m.label, () => { this.mode = m.id; this.showSetup(); }, { width: 560, height: 72 })); }); - this.track(new Button(this, GAME_WIDTH / 2, 720, 'Leave', () => { + this.track(new Button(this, GAME_WIDTH / 2, 1020, 'Leave', () => { this.scene.start('GameMenu'); }, { width: 260, height: 60 }));