From 15c76c38846a28e16bfca17b0577f7606a140301 Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Mon, 9 Dec 2019 14:54:09 -0500 Subject: [PATCH] Initial music playing code. --- mapgen.lua | 1 - sound.lua | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mapgen.lua b/mapgen.lua index 6578c61..87059c6 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -120,4 +120,3 @@ function generate_map(start) end end end - diff --git a/sound.lua b/sound.lua index f4a6362..8bf1535 100644 --- a/sound.lua +++ b/sound.lua @@ -3,6 +3,13 @@ function init_sound() -- each name maps to a pattern number to play music_map = { - desert = 0, + desert = 0 } end + +-- call this once to initialize biome sound. +-- by convention channel 4 should always be the +-- preferred sfx channel, so we unmask it. +function play_biome_music(biome) + music(music_map[biome], 2000, 7) +end