Skip to content

Commit

Permalink
Add music theming.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaythebusinessgoose committed Mar 9, 2022
1 parent 89109b0 commit 0c4cf92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ Enum bitmask of the types of growables that will spawn.
Customize the background to look like the background of `background_theme`.
* `floor_theme` THEME \
Customize the floor textures to look like the floors of `floor_theme`.
* `music_theme` THEME \
Customize the music to play the music for `music_theme`.
* `post_configure` function(CustomTheme, Subtheme) \
Function that allows additional configuration of the CustomTheme that was created from the properties.

Expand Down
6 changes: 6 additions & 0 deletions level_sequence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,12 @@ local function update_state_and_doors()
state.world = current_level.world or index_of_level(current_level)
state.level = current_level.level or 1

if current_level.music then
state.theme = current_level.music
elseif current_level.music_theme then
state.theme = current_level.music_theme
end

if sequence_state.keep_progress then
-- Setting the _start properties of the state will ensure that Instant Restarts will take
-- the player back to the current level, instead of going to the starting level.
Expand Down

0 comments on commit 0c4cf92

Please sign in to comment.