feat(worms): add background image to mode selection screen
Add optional background image to the worms game mode select screen. The image is loaded via asset manifest and displayed behind UI elements. Reposition buttons to accommodate the new background layout.
This commit is contained in:
parent
2268c74918
commit
95b200022c
Binary file not shown.
|
After Width: | Height: | Size: 1.8 MiB |
|
|
@ -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: [
|
||||
|
|
|
|||
|
|
@ -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 }));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue