main.lua:
local world1Soundtrack = audio.loadStream("AClimber\_World\_1.mp3")
\_G.playWorld1Soundtrack = function()
audio.play(world1Soundtrack, {channel=32})
end
\_G.stopWorld1Soundtrack = function()
audio.stop(32)
timer.cancel(\_G.bbbbbb)
\_G.bbbbbb = nil
end
Then in every level:
if world1Soundtrack then
timer.cancel(\_G.bbbbbb)
\_G.bbbbbb = nil
\_G.bbbbbb = timer.performWithDelay(20, \_G. playWorld1Soundtrack, 0)
else
\_G.bbbbbb = timer.performWithDelay(20, \_G. playWorld1Soundtrack, 0)
end
When you want to stop the loop, at the exit of a level:
_G.stopWorld1Soundtrack()
[import]uid: 47300 topic_id: 18684 reply_id: 72106[/import]