feat(gootower): replace sky drawing with background image asset

- Add gootower-bg to asset manifest
- Replace drawSky() with drawBackground() method that renders the background texture
- Display background when entering play mode
This commit is contained in:
Brian Fertig 2026-07-26 15:37:31 -06:00
parent 5b24cc3ad0
commit 6e9cc84f6a
4 changed files with 11 additions and 2 deletions

BIN
assets/fx/ta-nuclear.mp3 Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@ -61,6 +61,9 @@ const sheet = (key, path, frameWidth, frameHeight) => ({ type: 'spritesheet', ke
const image = (key, path) => ({ type: 'image', key, path });
export const MANIFEST = {
gootower: [
image('gootower-bg', 'assets/images/gootower/background-1.png'),
],
forbiddenisland: [
// Tiles: 2 cols (dry, flooded) × 24 rows. Row i → dry frame 2i, flooded
// frame 2i+1 (see IslandData.TILE_FRAME_ROW).

View File

@ -111,8 +111,6 @@ export default class GooTowerGame extends Phaser.Scene {
if (music?.tracks) new MusicPlayer(this, music.tracks);
} catch (_) { /* optional */ }
this.drawSky();
const raw = this.cache.json.get('gootower-levels');
this.manifest = (raw?.levels ?? []).slice().sort((a, b) => a.level - b.level);
this.chapters = raw?.chapters?.length
@ -139,6 +137,13 @@ export default class GooTowerGame extends Phaser.Scene {
g.fillRect(0, 0, GAME_WIDTH, GAME_HEIGHT);
}
drawBackground() {
if (this.textures.exists('gootower-bg')) {
this.add.image(GAME_WIDTH / 2, GAME_HEIGHT / 2, 'gootower-bg')
.setDisplaySize(GAME_WIDTH, GAME_HEIGHT).setDepth(D.sky);
}
}
clearBoard() {
for (const o of this.boardObjs) o.destroy();
this.boardObjs = [];
@ -308,6 +313,7 @@ export default class GooTowerGame extends Phaser.Scene {
if (!def) { this.showSelect(); return; }
this.clearBoard();
this.drawBackground();
this.viewMode = 'play';
this.level = level;
this.levelDef = def;