--[[ -- Music will get called with a string parameter indicating status. -- Valid Parameters: -- load - game is loading. -- land - player landed. -- takeoff - player took off. -- combat - Player just got a hostile on screen. -- idle - Current playing music ran out. ]]-- last = "idle" function choose(str) if str == "load" then music.load("machina") music.play() elseif str == "land" then music.load("agriculture") music.play() elseif str == "takeoff" then music.load("liftoff") 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. end if last ~= "idle" then last = str -- Save the last string so we can use it. end end