From 0b9f89e4a99436373efa6078f2de52bb79ca2579 Mon Sep 17 00:00:00 2001 From: Allanis <allanis@saracraft.net> Date: Sat, 24 Aug 2013 10:51:56 +0100 Subject: [PATCH] [Add] Music now plays constantly. --- snd/music.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/snd/music.lua b/snd/music.lua index b8a8f1d..01f79f3 100644 --- a/snd/music.lua +++ b/snd/music.lua @@ -21,15 +21,24 @@ function choose(str) music.load("liftoff") music.play() + elseif str == "ambient" then + music.load("machina") + music.play() + elseif str == "combat" then music.load("galacticbattle") music.play() 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 - if last ~= "idle" then + if str ~= "idle" then last = str -- Save the last string so we can use it. end end