chessmasterhong / WaterEmblem

https://chessmasterhong.bitbucket.io/projects/WaterEmblem/
118 stars 27 forks source link

Refactor sound effects #152

Closed chessmasterhong closed 9 years ago

chessmasterhong commented 9 years ago

The method of implementation of sound effects in pull request #149, although functional, could use refactoring to ensure scalability in the event we have to add or modify a large amount of sound effects.

Currently, each sound effect is stored in their own property in the ig.game namespace and the volume for each is individually set for each sound effect.

This can be improved by storing the sound effects in ig.music as a track and allowing the engine to handle it. In addition, by doing so, it allows the engine to configure the volume and any other code configuration of all sound effects in the track with minimal effort.