Añadido el esqueleto para dos secciones nuevas: ending y game_over

This commit is contained in:
2022-11-02 22:50:25 +01:00
parent bb992b7d90
commit a510742984
7 changed files with 443 additions and 1 deletions

View File

@@ -298,6 +298,24 @@ void Director::loadResources(section_t section)
resource->loadOffsets(offsetsList);
}
else if (section.name == SECTION_PROG_ENDING)
{
std::vector<std::string> textureList;
textureList.push_back("jailgames.png");
textureList.push_back("since_1998.png");
resource->loadTextures(textureList);
}
else if (section.name == SECTION_PROG_GAME_OVER)
{
std::vector<std::string> textureList;
textureList.push_back("jailgames.png");
textureList.push_back("since_1998.png");
resource->loadTextures(textureList);
}
else if (section.name == SECTION_PROG_GAME || section.name == SECTION_PROG_DEMO)
{
// Texturas
@@ -1166,6 +1184,34 @@ void Director::runDemo()
resource->free();
}
// Ejecuta la seccion del final del juego
void Director::runEnding()
{
if (options->console)
{
std::cout << "\n* SECTION: ENDING" << std::endl;
}
loadResources(section);
ending = new Ending(renderer, screen, resource, asset, options);
setSection(ending->run());
delete ending;
resource->free();
}
// Ejecuta la seccion del final de la partida
void Director::runGameOver()
{
if (options->console)
{
std::cout << "\n* SECTION: GAME OVER" << std::endl;
}
loadResources(section);
gameOver = new GameOver(renderer, screen, resource, asset, options);
setSection(gameOver->run());
delete gameOver;
resource->free();
}
// Ejecuta la seccion de juego donde se juega
void Director::runGame()
{