Retocado el menu del titulo
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -46,7 +46,7 @@ Title::~Title()
|
||||
|
||||
delete text;
|
||||
text = nullptr;
|
||||
|
||||
|
||||
delete text2;
|
||||
text2 = nullptr;
|
||||
|
||||
@@ -64,9 +64,9 @@ void Title::initMenu()
|
||||
menu->loadAudioFile(asset->get("sound_menu_move.wav"), SOUND_MOVE);
|
||||
|
||||
menu->init("TITLE", 0, 150, MENU_BACKGROUND_TRANSPARENT);
|
||||
menu->addItem("START",2);
|
||||
menu->addItem("START", 2);
|
||||
menu->addItem("OPTIONS", 5);
|
||||
menu->addItem("EXIT");
|
||||
menu->addItem("EXIT");
|
||||
menu->setDefaultActionWhenCancel(2);
|
||||
menu->setBackgroundColor({0x30, 0x30, 0x40}, 192);
|
||||
menu->setSelectorColor({0xe5, 0x1c, 0x23}, 0);
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user