Skip to content

Commit

Permalink
Noteblock: Fade out fire sound (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wuzzy2 committed Sep 17, 2020
1 parent 9fda51b commit fedbf49
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mesecons_noteblock/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,11 @@ mesecon.noteblock_play = function(pos, param2)
end
end
pos.y = pos.y+1
minetest.sound_play(soundname, { pos = pos }, true)
if soundname == "fire_fire" then
-- Smoothly fade out fire sound
local handle = minetest.sound_play(soundname, {pos = pos, loop = true})
minetest.after(3.0, minetest.sound_fade, handle, -1.5, 0.0)
else
minetest.sound_play(soundname, {pos = pos}, true)
end
end

0 comments on commit fedbf49

Please sign in to comment.