forked from jaildesigner-jailgames/jaildoctors_dilemma
mes reestructuracio de fitxers de codi
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
#include "game/scene_manager.hpp" // Para SceneManager
|
||||
|
||||
#include "game/scenes/logo.hpp"
|
||||
|
||||
#include <SDL3/SDL.h>
|
||||
@@ -9,7 +7,8 @@
|
||||
#include "core/rendering/surface.hpp" // Para Surface
|
||||
#include "core/rendering/surface_sprite.hpp" // Para SSprite
|
||||
#include "core/resources/resource.hpp" // Para Resource
|
||||
#include "game/gameplay/options.hpp" // Para Options, SectionState, options, Section
|
||||
#include "game/options.hpp" // Para Options, SectionState, options, Section
|
||||
#include "game/scene_manager.hpp" // Para SceneManager
|
||||
#include "utils/defines.hpp" // Para GAME_SPEED
|
||||
#include "utils/global_events.hpp" // Para check
|
||||
#include "utils/utils.hpp" // Para PaletteColor
|
||||
@@ -165,23 +164,13 @@ void Logo::updateTextureColors() {
|
||||
void Logo::update() {
|
||||
// Comprueba que la diferencia de ticks sea mayor a la velocidad del juego
|
||||
if (SDL_GetTicks() - ticks_ > GAME_SPEED) {
|
||||
// Actualiza el contador de ticks
|
||||
ticks_ = SDL_GetTicks();
|
||||
ticks_ = SDL_GetTicks(); // Actualiza el contador de ticks
|
||||
|
||||
// Comprueba las entradas
|
||||
checkInput();
|
||||
|
||||
// Incrementa el contador
|
||||
counter_++;
|
||||
|
||||
// Gestiona el logo de JAILGAME
|
||||
updateJAILGAMES();
|
||||
|
||||
// Gestiona el color de las texturas
|
||||
updateTextureColors();
|
||||
|
||||
// Actualiza el objeto Screen
|
||||
Screen::get()->update();
|
||||
checkInput(); // Comprueba las entradas
|
||||
counter_++; // Incrementa el contador
|
||||
updateJAILGAMES(); // Gestiona el logo de JAILGAME
|
||||
updateTextureColors(); // Gestiona el color de las texturas
|
||||
Screen::get()->update(); // Actualiza el objeto Screen
|
||||
|
||||
// Comprueba si ha terminado el logo
|
||||
if (counter_ == END_LOGO_ + POST_LOGO_) {
|
||||
@@ -217,11 +206,17 @@ void Logo::run() {
|
||||
|
||||
// Termina la sección
|
||||
void Logo::endSection() {
|
||||
if (SceneManager::options == SceneManager::Options::LOGO_TO_TITLE) {
|
||||
SceneManager::current = SceneManager::Scene::TITLE;
|
||||
}
|
||||
switch (SceneManager::options) {
|
||||
case SceneManager::Options::LOGO_TO_TITLE:
|
||||
SceneManager::current = SceneManager::Scene::TITLE;
|
||||
break;
|
||||
|
||||
else if (SceneManager::options == SceneManager::Options::LOGO_TO_INTRO) {
|
||||
SceneManager::current = SceneManager::Scene::LOADING_SCREEN;
|
||||
case SceneManager::Options::LOGO_TO_LOADING_SCREEN:
|
||||
SceneManager::current = SceneManager::Scene::LOADING_SCREEN;
|
||||
break;
|
||||
|
||||
default:
|
||||
// Ninguna acción por defecto
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user