Ya rueda por los diferentes estados del juego: logo, titulo, creditos, demo

This commit is contained in:
2022-10-13 12:36:34 +02:00
parent 3f3f50a583
commit 4d462e6564
8 changed files with 49 additions and 41 deletions

View File

@@ -1,7 +1,7 @@
#include "logo.h"
// Constructor
Logo::Logo(SDL_Renderer *renderer, Screen *screen, Asset *asset)
Logo::Logo(SDL_Renderer *renderer, Screen *screen, Asset *asset, int subsection)
{
// Copia la dirección de los objetos
this->renderer = renderer;
@@ -33,7 +33,7 @@ Logo::Logo(SDL_Renderer *renderer, Screen *screen, Asset *asset)
// Inicializa variables
counter = 0;
section.name = SECTION_PROG_LOGO;
section.subsection = 0;
section.subsection = subsection;
ticks = 0;
ticksSpeed = 15;
initFade = 300;
@@ -238,8 +238,16 @@ void Logo::update()
// Comprueba si ha terminado el logo
if (counter == endLogo + postLogo)
{
section.name = SECTION_PROG_INTRO;
section.subsection = 0;
if (section.subsection == SUBSECTION_LOGO_TO_INTRO)
{
section.name = SECTION_PROG_INTRO;
section.subsection = 0;
}
else
{
section.name = SECTION_PROG_TITLE;
section.subsection = 0;
}
}
}
}