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

@@ -52,7 +52,7 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input, D
board.music = !debug->getEnabled();
section.name = SECTION_PROG_GAME;
section.subsection = SUBSECTION_GAME_PLAY;
section.subsection = 0;
}
Game::~Game()
@@ -175,12 +175,8 @@ section_t Game::run()
while (section.name == SECTION_PROG_GAME)
{
// Sección juego jugando
if (section.subsection == SUBSECTION_GAME_PLAY)
{
update();
render();
}
update();
render();
}
JA_StopMusic();
@@ -243,9 +239,9 @@ void Game::render()
// Pasa la información de debug
void Game::updateDebugInfo()
{
debug->add("X = " + std::to_string((int)player->x) + ", Y = " + std::to_string((int)player->y));
debug->add("VX = " + std::to_string(player->vx).substr(0, 4) + ", VY = " + std::to_string(player->vy).substr(0, 4));
debug->add("STATE = " + std::to_string(player->state));
debug->add("X = " + std::to_string((int)player->x) + ", Y = " + std::to_string((int)player->y));
debug->add("VX = " + std::to_string(player->vx).substr(0, 4) + ", VY = " + std::to_string(player->vy).substr(0, 4));
debug->add("STATE = " + std::to_string(player->state));
}
// Pone la información de debug en pantalla