1
0
mirror of https://codeberg.org/tenplus1/ambience.git synced 2026-01-12 03:35:25 +01:00

add fade option for sounds

This commit is contained in:
tenplus1
2026-01-09 07:14:40 +00:00
parent bc5d9367bb
commit 15f2d512a1
2 changed files with 2 additions and 2 deletions

View File

@@ -38,7 +38,7 @@ ambience.add_set("windy", {
frequency = 500,
nodes = {"default:sand"},
sounds = {
{name = "wind", length = 9, gain = 0.3},
{name = "wind", length = 9, gain = 0.3, fade = 1.0},
{name = "desertwind", length = 8, gain = 0.3},
{name = "crow", length = 3, ephemeral = true},
},

View File

@@ -281,7 +281,7 @@ core.register_globalstep(function(dtime)
handler = core.sound_play(ambience.name, {
to_player = pname,
gain = ((ambience.gain or 0.3) + (MORE_GAIN or 0)) * playing[pname].svol,
pitch = ambience.pitch or 1.0
pitch = ambience.pitch or 1.0, fade = ambience.fade
}, ambience.ephemeral)
--print ("playing... " .. ambience.name .. " (" .. chance .. " < "