pasada de granera
This commit is contained in:
@@ -95,12 +95,7 @@ void Debug::setDebugFile(const std::string& path) {
|
||||
// Convierte string a SceneManager::Scene (para debug.yaml)
|
||||
static auto sceneFromString(const std::string& s) -> SceneManager::Scene {
|
||||
if (s == "LOGO") { return SceneManager::Scene::LOGO; }
|
||||
if (s == "LOADING") { return SceneManager::Scene::LOADING_SCREEN; }
|
||||
if (s == "TITLE") { return SceneManager::Scene::TITLE; }
|
||||
if (s == "CREDITS") { return SceneManager::Scene::CREDITS; }
|
||||
if (s == "DEMO") { return SceneManager::Scene::DEMO; }
|
||||
if (s == "ENDING") { return SceneManager::Scene::ENDING; }
|
||||
if (s == "ENDING2") { return SceneManager::Scene::ENDING2; }
|
||||
return SceneManager::Scene::GAME; // Fallback seguro
|
||||
}
|
||||
|
||||
@@ -109,18 +104,8 @@ static auto sceneToString(SceneManager::Scene scene) -> std::string {
|
||||
switch (scene) {
|
||||
case SceneManager::Scene::LOGO:
|
||||
return "LOGO";
|
||||
case SceneManager::Scene::LOADING_SCREEN:
|
||||
return "LOADING";
|
||||
case SceneManager::Scene::TITLE:
|
||||
return "TITLE";
|
||||
case SceneManager::Scene::CREDITS:
|
||||
return "CREDITS";
|
||||
case SceneManager::Scene::DEMO:
|
||||
return "DEMO";
|
||||
case SceneManager::Scene::ENDING:
|
||||
return "ENDING";
|
||||
case SceneManager::Scene::ENDING2:
|
||||
return "ENDING2";
|
||||
default:
|
||||
return "GAME";
|
||||
}
|
||||
|
||||
@@ -23,12 +23,7 @@
|
||||
#include "game/gameplay/cheevos.hpp" // Para Cheevos
|
||||
#include "game/options.hpp" // Para Options, options, OptionsVideo
|
||||
#include "game/scene_manager.hpp" // Para SceneManager
|
||||
#include "game/scenes/credits.hpp" // Para Credits
|
||||
#include "game/scenes/ending.hpp" // Para Ending
|
||||
#include "game/scenes/ending2.hpp" // Para Ending2
|
||||
#include "game/scenes/game.hpp" // Para Game, GameMode
|
||||
#include "game/scenes/game_over.hpp" // Para GameOver
|
||||
#include "game/scenes/loading_screen.hpp" // Para LoadingScreen
|
||||
#include "game/scenes/logo.hpp" // Para Logo
|
||||
#include "game/scenes/title.hpp" // Para Title
|
||||
#include "game/ui/console.hpp" // Para Console
|
||||
@@ -330,48 +325,12 @@ void Director::runLogo() {
|
||||
logo->run();
|
||||
}
|
||||
|
||||
// Ejecuta la seccion de juego de la pantalla de carga
|
||||
void Director::runLoadingScreen() {
|
||||
auto loading_screen = std::make_unique<LoadingScreen>();
|
||||
loading_screen->run();
|
||||
}
|
||||
|
||||
// Ejecuta la seccion de juego con el titulo y los menus
|
||||
void Director::runTitle() {
|
||||
auto title = std::make_unique<Title>();
|
||||
title->run();
|
||||
}
|
||||
|
||||
// Ejecuta la seccion de los creditos del juego
|
||||
void Director::runCredits() {
|
||||
auto credits = std::make_unique<Credits>();
|
||||
credits->run();
|
||||
}
|
||||
|
||||
// Ejecuta la seccion de la demo, donde se ven pantallas del juego
|
||||
void Director::runDemo() {
|
||||
auto game = std::make_unique<Game>(Game::Mode::DEMO);
|
||||
game->run();
|
||||
}
|
||||
|
||||
// Ejecuta la seccion del final del juego
|
||||
void Director::runEnding() {
|
||||
auto ending = std::make_unique<Ending>();
|
||||
ending->run();
|
||||
}
|
||||
|
||||
// Ejecuta la seccion del final del juego
|
||||
void Director::runEnding2() {
|
||||
auto ending2 = std::make_unique<Ending2>();
|
||||
ending2->run();
|
||||
}
|
||||
|
||||
// Ejecuta la seccion del final de la partida
|
||||
void Director::runGameOver() {
|
||||
auto game_over = std::make_unique<GameOver>();
|
||||
game_over->run();
|
||||
}
|
||||
|
||||
// Ejecuta la seccion de juego donde se juega
|
||||
void Director::runGame() {
|
||||
Audio::get()->stopMusic();
|
||||
@@ -389,38 +348,14 @@ auto Director::run() -> int {
|
||||
runLogo();
|
||||
break;
|
||||
|
||||
case SceneManager::Scene::LOADING_SCREEN:
|
||||
runLoadingScreen();
|
||||
break;
|
||||
|
||||
case SceneManager::Scene::TITLE:
|
||||
runTitle();
|
||||
break;
|
||||
|
||||
case SceneManager::Scene::CREDITS:
|
||||
runCredits();
|
||||
break;
|
||||
|
||||
case SceneManager::Scene::DEMO:
|
||||
runDemo();
|
||||
break;
|
||||
|
||||
case SceneManager::Scene::GAME:
|
||||
runGame();
|
||||
break;
|
||||
|
||||
case SceneManager::Scene::GAME_OVER:
|
||||
runGameOver();
|
||||
break;
|
||||
|
||||
case SceneManager::Scene::ENDING:
|
||||
runEnding();
|
||||
break;
|
||||
|
||||
case SceneManager::Scene::ENDING2:
|
||||
runEnding2();
|
||||
break;
|
||||
|
||||
case SceneManager::Scene::RESTART_CURRENT:
|
||||
// La escena salió por RESTART_CURRENT → relanzar la escena guardada
|
||||
SceneManager::current = SceneManager::scene_before_restart;
|
||||
|
||||
@@ -19,12 +19,6 @@ class Director {
|
||||
void createSystemFolder(const std::string& folder); // Crea la carpeta del sistema donde guardar datos
|
||||
void setFileList(); // Carga la configuración de assets desde assets.yaml
|
||||
static void runLogo(); // Ejecuta la seccion de juego con el logo
|
||||
static void runLoadingScreen(); // Ejecuta la seccion de juego de la pantalla de carga
|
||||
static void runTitle(); // Ejecuta la seccion de juego con el titulo y los menus
|
||||
static void runCredits(); // Ejecuta la seccion de los creditos del juego
|
||||
static void runDemo(); // Ejecuta la seccion de la demo, donde se ven pantallas del juego
|
||||
static void runEnding(); // Ejecuta la seccion del final del juego
|
||||
static void runEnding2(); // Ejecuta la seccion del final del juego
|
||||
static void runGameOver(); // Ejecuta la seccion del final de la partida
|
||||
static void runGame(); // Ejecuta la seccion de juego donde se juega
|
||||
};
|
||||
Reference in New Issue
Block a user