Lephisto/snd/music.lua

35 lines
775 B
Lua

--[[
-- 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.
--]]--
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" then
choose(last) -- This should be smarter in the future.
end
last = str -- Save the last string so we can use it.
end