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_over.hpp"
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
@@ -23,8 +25,8 @@ GameOver::GameOver()
|
||||
pre_counter_(0),
|
||||
counter_(0),
|
||||
ticks_(0) {
|
||||
Options::section.section = Options::Scene::GAME_OVER;
|
||||
Options::section.subsection = Options::SceneOptions::NONE;
|
||||
SceneManager::current = SceneManager::Scene::GAME_OVER;
|
||||
SceneManager::options = SceneManager::Options::NONE;
|
||||
|
||||
player_sprite_->setPosX(GAMECANVAS_CENTER_X + 10);
|
||||
player_sprite_->setPosY(30);
|
||||
@@ -112,7 +114,7 @@ void GameOver::checkInput() {
|
||||
|
||||
// Bucle principal
|
||||
void GameOver::run() {
|
||||
while (Options::section.section == Options::Scene::GAME_OVER) {
|
||||
while (SceneManager::current == SceneManager::Scene::GAME_OVER) {
|
||||
update();
|
||||
checkEvents();
|
||||
render();
|
||||
@@ -156,7 +158,7 @@ void GameOver::updateCounters() {
|
||||
|
||||
// Comprueba si ha terminado la sección
|
||||
else if (counter_ == COUNTER_SECTION_END_) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user