Closed henriiquecampos closed 6 years ago
Wow okay that's not what I expected. I don't want random assets packaged with the game: only relevant sounds. Can you send me a zip file instead? I'll add you as a contributor manually on the commit when I add the sounds the game needs.
Sure. Here, the zip with the samples (.ogg) and the AudioLibraryFactory.gd
with the SoundEffectLibrary.gd
if you find them useful.
Hey there, since I am implementing some public domain assets, from kenney I thought that some of them may be helpful.
So let me give a bit of context for this.
AudioStreamRandomPitch
Since we can't set random pitch on importing settings, I decided that it would be good to have
AudioStreamRandomPitch
resources for each sound effect, so they are the default resource used in theAudioStreamPlayer
nodes, the source*.ogg
can be found in the*/source
folder.SoundEffectLibrary
This is a collection of
AudioStreamPlayer
nodes that behaves like a library. The idea is that you can put as manyAudioStreamPlayers
as needed and play them using the Library as interface. A good example would be to have aSoundEffectLibrary
for the footsteps. If you want to play a specific one you can callSoundEffectLibrary.play(name_of_the_effect)
wherename_of_the_effect
is the name of the node. But if you want to play a random effect you can just callSoundEffectLibrary.play()
and it will randomly pick a child and play it. An example hierarchy:AudioLibraryFactory
This is an EditorScript that takes a
SoundEffectLibrary.source_directory
and automatically creates the neededAudioSampleRandomPitches
andAudioStreamPlayers
as child of theSoundEffectLibrary
, that :warning: MUST BE THE ROOT NODE when running this script.Well, lemme know if anything at all must be changed or removed. I hope this helps! :heart: