Closed JRVeale closed 5 years ago
Check if sound already playing before playing starting. (Otherwise something like an on collision sound will keep being triggered and will play multiple copies of sound across until fills the available channels)
Add if volume less than 1 don't play
Version of play sound with number of loops to play sound
TODO: AudioComponent react to there not being a sound in the map for the id requested! (an annoying superloud klaxon would do for dev...)
Addressed so far by #12
Create entities with sound components for sound effects. https://www.reddit.com/r/gamedev/comments/bei8so/how_to_make_dynamic_ambient_sound_in_your_game/?utm_medium=android_app&utm_source=share something like this for volume control (comments have useful stuff on random pitch shifting etc). Can then have entities with no sprite (just transform and sound) for ambience, and can give enemies/items sound too.
Within sound component: ambient sounds, triggered sounds.
Add and remove from group based on distance from player to ensure only bother with sound generation when useful. (Generating at zero volume could slow things down)