Skip to content

Commit

Permalink
update music on menu
Browse files Browse the repository at this point in the history
  • Loading branch information
fallahn committed Oct 27, 2024
1 parent d44f5ea commit f16b534
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion samples/golf/src/golf/MenuState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2017,7 +2017,15 @@ void MenuState::createScene()

//music
auto entity = m_backgroundScene.createEntity();
entity.addComponent<cro::AudioEmitter>() = m_menuSounds.getEmitter("music");
if (cro::SysTime::now().months() == 10
&& cro::SysTime::now().days() > 22)
{
entity.addComponent<cro::AudioEmitter>() = m_menuSounds.getEmitter("spooky_music");
}
else
{
entity.addComponent<cro::AudioEmitter>() = m_menuSounds.getEmitter("music");
}
entity.getComponent<cro::AudioEmitter>().play();
entity.getComponent<cro::AudioEmitter>().setLooped(true);

Expand Down

0 comments on commit f16b534

Please sign in to comment.