This commit is contained in:
2024-10-23 18:29:52 +02:00
parent 95478134dd
commit 6e2f80d8ce
26 changed files with 232 additions and 290 deletions

View File

@@ -21,17 +21,13 @@ struct JA_Music_t; // lines 19-19
// Constructor
Intro::Intro()
: texture_(Resource::get()->getTexture("intro.png"))
: texture_(Resource::get()->getTexture("intro.png")),
text_(std::make_shared<Text>(Resource::get()->getTexture("nokia.png"), Resource::get()->getTextFile("nokia.txt")))
{
// Reserva memoria para los objetos
text_ = std::make_shared<Text>(Resource::get()->getTexture("nokia.png"), Resource::get()->getTextFile("nokia.txt"));
// Inicializa variables
section::name = section::Name::INTRO;
section::options = section::Options::NONE;
ticks_ = 0;
ticks_speed_ = 15;
scene_ = 1;
// Inicializa los bitmaps de la intro
constexpr int totalBitmaps = 6;
@@ -372,7 +368,9 @@ void Intro::updateScenes()
// Actualiza las variables del objeto
void Intro::update()
{
if (SDL_GetTicks() - ticks_ > ticks_speed_)
constexpr int TICKS_SPEED = 15;
if (SDL_GetTicks() - ticks_ > TICKS_SPEED)
{
// Actualiza el contador de ticks
ticks_ = SDL_GetTicks();