sounds day&night
axelmine opened this issue · 2 comments
Please add function play sounds day and night
my code your fix
function playBackgroundSound()
local hour,minutes = getTime( )
if hour >= 6 and hour < 12 then
if time == 0 or (time ~= 1 and isElement(sound)) then
stopSound(sound)
sound = playSound ( "day.mp3",true )
end
time = 1
elseif ( hour >= 12 ) and ( hour < 15 ) then
if time == 0 or (time ~= 1 and isElement(sound)) then
stopSound(sound)
sound = playSound ( "day.mp3",true )
end
time = 1
elseif ( hour >= 15 ) and ( hour < 20 ) then
if time == 0 or (time ~= 2 and isElement(sound)) then
stopSound(sound)
sound = playSound ( "night.mp3",true )
end
time = 2
elseif ( hour >= 20 ) and ( hour < 24 ) then
if time == 0 or (time ~= 2 and isElement(sound)) then
stopSound(sound)
sound = playSound ( "night.mp3",true )
end
time = 2
end
end
You could make a pull request
That code won't work as we're missing "day.mp3" and "night.mp3". Besides, there's really no need for even more ambience sounds, as we already have this playing in the background. Sorry, but I'm not going to accept this at its current state, which is why I'm closing this issue.