[Add] Music now plays constantly.

This commit is contained in:
Allanis 2013-08-24 10:51:56 +01:00
parent f3ef4a9cf1
commit 0b9f89e4a9

View File

@ -21,15 +21,24 @@ function choose(str)
music.load("liftoff") music.load("liftoff")
music.play() music.play()
elseif str == "ambient" then
music.load("machina")
music.play()
elseif str == "combat" then elseif str == "combat" then
music.load("galacticbattle") music.load("galacticbattle")
music.play() music.play()
elseif str == "idle" and last ~= "idle" then elseif str == "idle" and last ~= "idle" then
choose(last) -- This should be smarter in the future. -- We'll play the same as last unless it was takeoff.
if last == "takeoff" then
choose("ambient")
else
choose(last)
end
end end
if last ~= "idle" then if str ~= "idle" then
last = str -- Save the last string so we can use it. last = str -- Save the last string so we can use it.
end end
end end