Skip to content

Instantly share code, notes, and snippets.

@anzfactory
Last active August 29, 2015 14:01
Show Gist options
  • Save anzfactory/4c9ef455b5905aa239c3 to your computer and use it in GitHub Desktop.
Save anzfactory/4c9ef455b5905aa239c3 to your computer and use it in GitHub Desktop.
void play()
{
// 一旦0に(SpriteをFadeInするときとかに、最初は非表示にしておくようなもん)
SimpleAudioEngine::getInstanse->setBackgroundMusicVolume(0.f);
stopAllActions(); // 多重実行しないように
runAction(Sequence::create(
PlayBGM::create("bgm.mp3"), // bgm再生
FadeToVolumeOfBGM::create(3.f, .5f), // 3秒かけて音量0.5に
DelayTime::create(5.f),
FadeToVolumeOfBGM::create(3.f, 0.f), // 3秒書けて音量0に
StopBGM::create(), // bgm停止
NULL
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment