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

@@ -139,22 +139,7 @@ void Demo::update()
room->update();
scoreboard->update();
screen->updateFX();
{
counter++;
if (counter == 400)
{
counter = 0;
roomIndex++;
if (roomIndex == (int)rooms.size())
{
section.name = SECTION_PROG_TITLE;
}
else
{
changeRoom(rooms.at(roomIndex));
}
}
}
checkRoomChange();
}
}
@@ -221,4 +206,24 @@ bool Demo::changeRoom(std::string file)
}
return false;
}
// Comprueba si se ha de cambiar de habitación
void Demo::checkRoomChange()
{
counter++;
if (counter == 400)
{
counter = 0;
roomIndex++;
if (roomIndex == (int)rooms.size())
{
section.name = SECTION_PROG_LOGO;
section.subsection = SUBSECTION_LOGO_TO_TITLE;
}
else
{
changeRoom(rooms.at(roomIndex));
}
}
}