diff --git a/idea.md b/idea.md index e5a3bb5..9a41816 100644 --- a/idea.md +++ b/idea.md @@ -42,6 +42,8 @@ - 每个怪物加一个怪物说明 - 歌词展示系统 - 小地图显示框,可以选择是否显示剩余怪物数量等 +- 怪物死亡特效 +- 区域名称显示特效,3D 粒子 ### 第二章 智慧 diff --git a/src/core/audio/sound.ts b/src/core/audio/sound.ts index 60094b0..aaa4b21 100644 --- a/src/core/audio/sound.ts +++ b/src/core/audio/sound.ts @@ -11,7 +11,7 @@ export class SoundEffect extends AudioPlayer { private _stopingAll: boolean = false; private playMap: Map = new Map(); - stereo: boolean = false; + private _stereo: boolean = false; gain: GainNode = AudioPlayer.ac.createGain(); panner: PannerNode | null = null; @@ -24,6 +24,14 @@ export class SoundEffect extends AudioPlayer { return this.gain.gain.value; } + set stereo(value: boolean) { + this._stereo = value; + this.initAudio(value); + } + get stereo(): boolean { + return this._stereo; + } + constructor(data: ArrayBuffer, stereo: boolean = false) { super(data); @@ -35,10 +43,10 @@ export class SoundEffect extends AudioPlayer { this.playMap.delete(node); }); this.on('update', () => { - this.initAudio(this.stereo); + this.initAudio(this._stereo); }); - this.stereo = stereo; + this._stereo = stereo; } /**