From 1656242563d14fa564bab8d4bc40054ab8998553 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 27 Feb 2021 12:05:45 -0500 Subject: Added background music (defined on a per-map basis) --- res/maps/hallucination_beach.tmx | 3 +++ res/maps/hallucination_cliff.tmx | 3 +++ res/maps/hallucination_hot_spring.tmx | 3 +++ res/maps/hallucination_interior.tmx | 3 +++ res/music/red_green_yellow_yellow.wav | Bin 0 -> 7078446 bytes res/scripts/common.lua | 8 +++++++- 6 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 res/music/red_green_yellow_yellow.wav (limited to 'res') diff --git a/res/maps/hallucination_beach.tmx b/res/maps/hallucination_beach.tmx index c6fd1cb..ce6c830 100644 --- a/res/maps/hallucination_beach.tmx +++ b/res/maps/hallucination_beach.tmx @@ -1,5 +1,8 @@ + + + diff --git a/res/maps/hallucination_cliff.tmx b/res/maps/hallucination_cliff.tmx index e6bd65e..8159d54 100644 --- a/res/maps/hallucination_cliff.tmx +++ b/res/maps/hallucination_cliff.tmx @@ -1,5 +1,8 @@ + + + diff --git a/res/maps/hallucination_hot_spring.tmx b/res/maps/hallucination_hot_spring.tmx index 2bb840d..b019681 100644 --- a/res/maps/hallucination_hot_spring.tmx +++ b/res/maps/hallucination_hot_spring.tmx @@ -1,5 +1,8 @@ + + + diff --git a/res/maps/hallucination_interior.tmx b/res/maps/hallucination_interior.tmx index e792133..ee7a5cd 100644 --- a/res/maps/hallucination_interior.tmx +++ b/res/maps/hallucination_interior.tmx @@ -1,5 +1,8 @@ + + + diff --git a/res/music/red_green_yellow_yellow.wav b/res/music/red_green_yellow_yellow.wav new file mode 100644 index 0000000..e1cd6dd Binary files /dev/null and b/res/music/red_green_yellow_yellow.wav differ diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 2a51419..a5e7873 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua @@ -260,7 +260,13 @@ function ChangeMap(map, warp, options) FadeToBlack(150) end loadMap(map) - character():transplantParty(playerId, getWarpPoint(warp), direction) + character():transplantParty(playerId, getMap():getWarpPoint(warp), direction) + + if (mixer():isPlayingMusic() and not getMap():hasMusic()) then + mixer():fadeoutMusic(150) + elseif (getMap():hasMusic() and (not mixer():isPlayingMusic() or not mixer():getPlayingTrack() == getMap():getMusic())) then + mixer():playMusic(getMap():getMusic(), 150) + end coroutine.yield() if (options & ChangeMapOptions.DO_NOT_FADE == 0) then -- cgit 1.4.1