-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Parsons
committed
Jun 15, 2024
1 parent
0241873
commit ca5b62f
Showing
8 changed files
with
105 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { Audios } from '~/src/types' | ||
export default class BattleScene extends Phaser.Scene { | ||
audioMute: boolean | ||
audios?: Audios | ||
constructor() { | ||
super({ key: 'battleScene' }) | ||
// 添加自己的變數 | ||
this.audioMute = true | ||
// this.audios = audios | ||
} | ||
init(data: { audios: Audios }) { | ||
// 初始化 | ||
this.audios = data.audios | ||
} | ||
preload() { | ||
// 預加載 | ||
if (!this.audios) return | ||
// 預加載音樂 | ||
Object.entries(this.audios).forEach(([key, value]) => { | ||
this.load.audio(key, value) | ||
}) | ||
} | ||
create() { | ||
console.log('BattleScene created', this) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters