JRVeale / hello-game

I started making a game engine. I got the jist of how they work, and decided it would be better to just use existing ones
0 stars 0 forks source link

Sounds #10

Closed JRVeale closed 5 years ago

JRVeale commented 5 years ago

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)

JRVeale commented 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)

JRVeale commented 5 years ago

Add if volume less than 1 don't play

JRVeale commented 5 years ago

Version of play sound with number of loops to play sound

JRVeale commented 5 years ago

TODO: AudioComponent react to there not being a sound in the map for the id requested! (an annoying superloud klaxon would do for dev...)

JRVeale commented 5 years ago

Addressed so far by #12