Replace SFX and add hold

This commit is contained in:
Mizu
2020-10-27 12:17:00 +01:00
parent d38168ca00
commit a324e0015a
10 changed files with 23 additions and 6 deletions

View File

@@ -15,6 +15,7 @@ sounds = {
main_decide = love.audio.newSource("res/se/main_decide.wav", "static"),
mode_decide = love.audio.newSource("res/se/mode_decide.wav", "static"),
lock = love.audio.newSource("res/se/lock.wav", "static"),
hold = love.audio.newSource("res/se/hold.wav", "static"),
erase = love.audio.newSource("res/se/erase.wav", "static"),
fall = love.audio.newSource("res/se/fall.wav", "static"),
ready = love.audio.newSource("res/se/ready.wav", "static"),
@@ -23,7 +24,7 @@ sounds = {
function playSE(sound, subsound)
if subsound == nil then
sounds[sound]:setVolume(0.1)
sounds[sound]:setVolume(0.5)
if sounds[sound]:isPlaying() then
sounds[sound]:stop()
end
@@ -39,13 +40,13 @@ end
function playSEOnce(sound, subsound)
if subsound == nil then
sounds[sound]:setVolume(0.1)
sounds[sound]:setVolume(0.5)
if sounds[sound]:isPlaying() then
return
end
sounds[sound]:play()
else
sounds[sound][subsound]:setVolume(0.1)
sounds[sound][subsound]:setVolume(0.5)
if sounds[sound][subsound]:isPlaying() then
return
end