示例#1
0
void GameStateManager::goToWinScreen()
{
	currentGameState = GS_WIN_SCREEN;
	if (isWorldRenderable())
		unloadCurrentLevel();
	//graphics->clearWorldTextures();
}
示例#2
0
void GameStateManager::goToGameOver()
{
	currentGameState = GS_GAME_OVER;
	if (isWorldRenderable())
		unloadCurrentLevel();
	//graphics->clearWorldTextures();

}
示例#3
0
/*
shutdown - this method is called when the user wants to quit the
application. This method updates the game state such that all
world resources are released and the game loop does not iterate
again.
*/
void GameStateManager::shutdown()
{
	// MAKE SURE THE GAME LOOP DOESN'T GO AROUND AGAIN
	currentGameState = GS_EXIT_GAME;

	// CLEAR LEFT OVER DATA
	if (isWorldRenderable())
		unloadCurrentLevel();
}
示例#4
0
/*
loadLevel - This method changes the current level. This method should
be called before loading all the data from a level file.
*/
void GameStateManager::loadLevel(Game *game, unsigned int initLevel)
{
	if ((initLevel > NO_LEVEL_LOADED) && (initLevel <= levelNames.size()))
	{
		if (currentLevel != NO_LEVEL_LOADED)
			unloadCurrentLevel();
		currentLevel = initLevel;
		wstring fileToLoad = levelFileNamesWithRelativePath[currentLevel];
		GameDataLoader *dataLoader = game->getDataLoader();
		dataLoader->loadWorld(game, fileToLoad);
	}
}