Added Background Music
This commit is contained in:
parent
321b491c7b
commit
8a386a4789
Binary file not shown.
|
|
@ -22,10 +22,15 @@ export class Game extends Phaser.Scene {
|
||||||
frameHeight: 100
|
frameHeight: 100
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Images
|
||||||
this.load.image('terrain-tileset', 'assets/images/terrain.png');
|
this.load.image('terrain-tileset', 'assets/images/terrain.png');
|
||||||
this.load.image('backpack', 'assets/images/backpack.png');
|
this.load.image('backpack', 'assets/images/backpack.png');
|
||||||
|
|
||||||
|
// Fonts
|
||||||
this.load.font('eraserDust', 'assets/fonts/EraserDust.ttf');
|
this.load.font('eraserDust', 'assets/fonts/EraserDust.ttf');
|
||||||
|
|
||||||
|
// Music
|
||||||
|
this.load.audio('bgMusic', 'assets/music/bgMusic.mp3');
|
||||||
}
|
}
|
||||||
|
|
||||||
create() {
|
create() {
|
||||||
|
|
@ -89,6 +94,11 @@ export class Game extends Phaser.Scene {
|
||||||
// Initialize cycle manager
|
// Initialize cycle manager
|
||||||
this.cycleManager = new CycleManager(this);
|
this.cycleManager = new CycleManager(this);
|
||||||
this.cycleManager.init();
|
this.cycleManager.init();
|
||||||
|
|
||||||
|
// Background Music
|
||||||
|
this.bgMusic = this.sound.add('bgMusic', { volume: 0.5 });
|
||||||
|
this.bgMusic.loop = true;
|
||||||
|
this.bgMusic.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
update(time, delta) {
|
update(time, delta) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue