forked from jaildesigner-jailgames/jaildoctors_dilemma
mogut options.section a SceneManager
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#include "game/scene_manager.hpp" // Para SceneManager
|
||||
|
||||
#include "game/scenes/game.hpp"
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
@@ -58,8 +60,8 @@ Game::Game(GameMode mode)
|
||||
Cheevos::get()->enable(!Options::cheats.enabled()); // Deshabilita los logros si hay trucos activados
|
||||
Cheevos::get()->clearUnobtainableState();
|
||||
|
||||
Options::section.section = (mode_ == GameMode::GAME) ? Options::Scene::GAME : Options::Scene::DEMO;
|
||||
Options::section.subsection = Options::SceneOptions::NONE;
|
||||
SceneManager::current = (mode_ == GameMode::GAME) ? SceneManager::Scene::GAME : SceneManager::Scene::DEMO;
|
||||
SceneManager::options = SceneManager::Options::NONE;
|
||||
}
|
||||
|
||||
Game::~Game() {
|
||||
@@ -100,7 +102,7 @@ void Game::run() {
|
||||
JA_PauseMusic();
|
||||
}
|
||||
|
||||
while (Options::section.section == Options::Scene::GAME || Options::section.section == Options::Scene::DEMO) {
|
||||
while (SceneManager::current == SceneManager::Scene::GAME || SceneManager::current == SceneManager::Scene::DEMO) {
|
||||
update();
|
||||
checkEvents();
|
||||
render();
|
||||
@@ -335,7 +337,7 @@ void Game::checkIfPlayerIsAlive() {
|
||||
// Comprueba si ha terminado la partida
|
||||
void Game::checkGameOver() {
|
||||
if (board_->lives < 0 && black_screen_counter_ > 17) {
|
||||
Options::section.section = Options::Scene::GAME_OVER;
|
||||
SceneManager::current = SceneManager::Scene::GAME_OVER;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,7 +429,7 @@ bool Game::checkEndGame() {
|
||||
// Comprueba los logros de completar el juego
|
||||
checkEndGameCheevos();
|
||||
|
||||
Options::section.section = Options::Scene::ENDING;
|
||||
SceneManager::current = SceneManager::Scene::ENDING;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -610,8 +612,8 @@ void Game::DEMO_checkRoomChange() {
|
||||
demo_.counter = 0;
|
||||
demo_.room_index++;
|
||||
if (demo_.room_index == (int)demo_.rooms.size()) {
|
||||
Options::section.section = Options::Scene::LOGO;
|
||||
Options::section.subsection = Options::SceneOptions::LOGO_TO_TITLE;
|
||||
SceneManager::current = SceneManager::Scene::LOGO;
|
||||
SceneManager::options = SceneManager::Options::LOGO_TO_TITLE;
|
||||
} else {
|
||||
changeRoom(demo_.rooms[demo_.room_index]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user