Treballant en el segon logo

This commit is contained in:
2025-02-07 14:55:34 +01:00
parent 84595da13a
commit 04ff428aa0
2 changed files with 72 additions and 24 deletions

View File

@@ -19,8 +19,7 @@
Logo::Logo()
: since_texture_(Resource::get()->getTexture("logo_since_1998.png")),
since_sprite_(std::make_unique<Sprite>(since_texture_)),
jail_texture_(Resource::get()->getTexture("logo_jailgames.png")),
ticks_(0)
jail_texture_(Resource::get()->getTexture("logo_jailgames.png"))
{
// Inicializa variables
@@ -114,7 +113,7 @@ void Logo::checkInput()
globalInputs::check();
}
// Gestiona el logo de JAILGAME
// Gestiona el logo de JAILGAMES
void Logo::updateJAILGAMES()
{
if (counter_ == 30)
@@ -149,6 +148,11 @@ void Logo::updateJAILGAMES()
}
}
// Gestiona el logo de RETROWEEKEND
void Logo::updateRETROWEEKEND()
{
}
// Gestiona el color de las texturas
void Logo::updateTextureColors()
{
@@ -190,11 +194,20 @@ void Logo::update()
// Comprueba las entradas
checkInput();
// Gestiona el logo de JAILGAME
updateJAILGAMES();
switch (state_)
{
case LogoState::JAILGAMES:
updateJAILGAMES();
updateTextureColors();
break;
// Gestiona el color de las texturas
updateTextureColors();
case LogoState::RETROWEEKEND:
updateRETROWEEKEND();
break;
default:
break;
}
// Gestiona el contador y sus eventos
counter_++;
@@ -213,24 +226,23 @@ void Logo::update()
// Dibuja en pantalla
void Logo::render()
{
// Prepara para empezar a dibujar en la textura de juego
Screen::get()->start();
// Limpia la pantalla
Screen::get()->clean();
// Dibuja los sprites
for (auto &sprite : jail_sprite_)
switch (state_)
{
sprite->render();
case LogoState::JAILGAMES:
renderJAILGAMES();
break;
case LogoState::RETROWEEKEND:
renderRETROWEEKEND();
break;
default:
break;
}
if (counter_ >= SHOW_SINCE_SPRITE_COUNTER_MARK)
{
since_sprite_->render();
}
// Vuelca el contenido del renderizador en pantalla
Screen::get()->render();
}
@@ -247,4 +259,24 @@ void Logo::run()
checkEvents(); // Tiene que ir antes del render
render();
}
}
// Renderiza el logo de JAILGAMES
void Logo::renderJAILGAMES()
{
// Dibuja los sprites
for (auto &sprite : jail_sprite_)
{
sprite->render();
}
if (counter_ >= SHOW_SINCE_SPRITE_COUNTER_MARK)
{
since_sprite_->render();
}
}
// Renderiza el logo de RETROWEEKEND
void Logo::renderRETROWEEKEND()
{
}