Add music and voice assets
This commit is contained in:
@@ -17,8 +17,15 @@ export class TitleScene extends Phaser.Scene {
|
||||
this.drawTitleMark(width, height);
|
||||
this.drawMenu(width, height);
|
||||
|
||||
this.input.once('pointerdown', () => soundDirector.start());
|
||||
this.input.keyboard?.once('keydown', () => soundDirector.start());
|
||||
soundDirector.playMusic('title-theme');
|
||||
const unlockAudio = () => {
|
||||
soundDirector.start();
|
||||
soundDirector.resume();
|
||||
soundDirector.playMusic('title-theme');
|
||||
};
|
||||
|
||||
this.input.once('pointerdown', unlockAudio);
|
||||
this.input.keyboard?.once('keydown', unlockAudio);
|
||||
this.input.keyboard?.once('keydown-ENTER', () => this.startGame());
|
||||
}
|
||||
|
||||
@@ -275,6 +282,8 @@ export class TitleScene extends Phaser.Scene {
|
||||
}
|
||||
|
||||
private startGame() {
|
||||
soundDirector.start();
|
||||
soundDirector.resume();
|
||||
soundDirector.playSelect();
|
||||
this.scene.start('StoryScene');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user