Example #1
0
void MainScene::preloadMusic()
{
    SimpleAudioEngine *pAudioEngine = SimpleAudioEngine::sharedEngine();
    pAudioEngine->preloadBackgroundMusic(BACK_MUSIC);
    pAudioEngine->preloadEffect(JUMP_MUSIC);
    pAudioEngine->preloadEffect(CROUCH_MUSIC);
}
KDvoid GameManager::showMenu ( KDvoid )
{
	m_eGameState = MainMenu;
	CCDirector::sharedDirector ( )->popScene ( );

	SimpleAudioEngine*		pSE = SimpleAudioEngine::sharedEngine ( );
	if ( !pSE->isBackgroundMusicPlaying ( ) && m_bMusicOn )
	{
		pSE->preloadBackgroundMusic ( "titletheme.mp3" );
	}
}
KDbool SoundManager::init ( KDvoid )
{
	SimpleAudioEngine*		pSE = SimpleAudioEngine::sharedEngine ( );

	// sound loading
	pSE->preloadEffect ( "sound_fx_chip_was_unselected.wav" );
	pSE->preloadEffect ( "sound_fx_regeneration.wav" );
	pSE->preloadEffect ( "sound_fx_selected_chip.wav" );
	pSE->preloadEffect ( "sound_fx_tap.wav" );
	pSE->preloadEffect ( "sound_fx_ready.wav" );
	pSE->preloadEffect ( "sound_fx_new_girl.mp3" );
	pSE->preloadEffect ( "sound_fx_incorrect_matching.mp3" );
	pSE->preloadEffect ( "sound_fx_game_over.mp3" );
	pSE->preloadEffect ( "sound_fx_correct_matching_with_wildcard.mp3" );
	pSE->preloadEffect ( "sound_fx_correct_matching.mp3" );
	
	// music
	pSE->preloadBackgroundMusic ( "sound_music_game.mp3" );
	pSE->preloadBackgroundMusic ( "sound_music_menu.mp3" );

	return KD_TRUE;
}