Ejemplo n.º 1
0
void CLevelPlay::loadMap(const int level)
{
	// Load the World map level.
	std::unique_ptr<CMapLoaderGalaxy> MapLoader;

    const int episode = gpBehaviorEngine->getEpisode();

    if(episode == 4)
    {
        MapLoader.reset(new CMapLoaderGalaxyEp4(mObjectPtr, mInventoryVec));
    }
    else if(episode == 5)
    {
        MapLoader.reset(new CMapLoaderGalaxyEp5(mObjectPtr, mInventoryVec));
    }
    else if(episode == 6)
    {
        MapLoader.reset(new CMapLoaderGalaxyEp6(mObjectPtr, mInventoryVec));
    }
    else
    {
        gLogging.textOut("Warning: Episode number does not make sense");
    }


	MapLoader->loadMap( mMap, level );

    // Load some new background Music
	g_pMusicPlayer->stop();

    if( loadLevelMusic(level) )
    {
        g_pMusicPlayer->play();
    }
    else
    {
        gLogging.textOut("Warning: The music cannot be played. Check that all the files have been correctly copied!");
    }
}
Ejemplo n.º 2
0
/**
 * The map is not loaded again after the game started. But we have to reload its song.
 */
void CWorldMap::loadAndPlayMusic()
{
    g_pMusicPlayer->stop();
    if(loadLevelMusic(0))
        g_pMusicPlayer->play();
}