Retocado el menu del titulo

This commit is contained in:
2022-08-28 07:50:08 +02:00
parent b6cbc65a2a
commit d937e5578f
4 changed files with 29 additions and 5 deletions

View File

@@ -27,7 +27,7 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input)
section.subsection = SUBSECTION_GAME_PLAY;
musicEnabled = true;
debug = true;
debug = false;
musicEnabled = !debug;
}

View File

@@ -26,7 +26,7 @@ Prog::Prog(std::string executablePath)
}
else
{
section.name = SECTION_PROG_GAME;
section.name = SECTION_PROG_LOGO;
}
input = new Input(asset->get("gamecontrollerdb.txt"));
screen = new Screen(window, renderer, options);

View File

@@ -103,6 +103,7 @@ void Title::update()
}
sprite->animate();
menu->update();
checkMenu();
}
}
@@ -139,3 +140,23 @@ section_t Title::run()
JA_StopMusic();
}
// Comprueba el menu
void Title::checkMenu()
{
const int menu = this->menu->getItemSelected();
switch (menu)
{
case 0:
section.name = SECTION_PROG_GAME;
break;
case 2:
section.name = SECTION_PROG_QUIT;
break;
default:
break;
}
}

View File

@@ -42,6 +42,9 @@ private:
// Crea el menu
void initMenu();
// Comprueba el menu
void checkMenu();
public:
// Constructor
Title(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input);