Skip to content

Commit

Permalink
added shuffle button logic
Browse files Browse the repository at this point in the history
  • Loading branch information
pundang committed Jul 9, 2024
1 parent 9c58d96 commit 3fdcf0b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ struct MenuLayerHook : Modify<MenuLayerHook, MenuLayer> {
}

void shuffleBtn(CCObject *sender) {
auto gameManager = GameManager::sharedState();
auto audioEngine = FMODAudioEngine::sharedEngine();

audioEngine->m_backgroundMusicChannel->stop();
songManager.pickRandomSong();
gameManager->playMenuMusic();
}
};

struct OptionsLayerHook : Modify<OptionsLayerHook, OptionsLayer> {
void customSetup() {
OptionsLayer::customSetup();
Expand Down

0 comments on commit 3fdcf0b

Please sign in to comment.