Added Background Music

This commit is contained in:
Brian Fertig 2025-08-17 15:51:16 -06:00
parent 321b491c7b
commit 8a386a4789
2 changed files with 10 additions and 0 deletions

BIN
assets/music/bgMusic.mp3 Normal file

Binary file not shown.

View File

@ -22,10 +22,15 @@ export class Game extends Phaser.Scene {
frameHeight: 100
});
// Images
this.load.image('terrain-tileset', 'assets/images/terrain.png');
this.load.image('backpack', 'assets/images/backpack.png');
// Fonts
this.load.font('eraserDust', 'assets/fonts/EraserDust.ttf');
// Music
this.load.audio('bgMusic', 'assets/music/bgMusic.mp3');
}
create() {
@ -89,6 +94,11 @@ export class Game extends Phaser.Scene {
// Initialize cycle manager
this.cycleManager = new CycleManager(this);
this.cycleManager.init();
// Background Music
this.bgMusic = this.sound.add('bgMusic', { volume: 0.5 });
this.bgMusic.loop = true;
this.bgMusic.play();
}
update(time, delta) {