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;
|
section.subsection = SUBSECTION_GAME_PLAY;
|
||||||
|
|
||||||
musicEnabled = true;
|
musicEnabled = true;
|
||||||
debug = true;
|
debug = false;
|
||||||
musicEnabled = !debug;
|
musicEnabled = !debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ Prog::Prog(std::string executablePath)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
section.name = SECTION_PROG_GAME;
|
section.name = SECTION_PROG_LOGO;
|
||||||
}
|
}
|
||||||
input = new Input(asset->get("gamecontrollerdb.txt"));
|
input = new Input(asset->get("gamecontrollerdb.txt"));
|
||||||
screen = new Screen(window, renderer, options);
|
screen = new Screen(window, renderer, options);
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ Title::~Title()
|
|||||||
|
|
||||||
delete text;
|
delete text;
|
||||||
text = nullptr;
|
text = nullptr;
|
||||||
|
|
||||||
delete text2;
|
delete text2;
|
||||||
text2 = nullptr;
|
text2 = nullptr;
|
||||||
|
|
||||||
@@ -64,9 +64,9 @@ void Title::initMenu()
|
|||||||
menu->loadAudioFile(asset->get("sound_menu_move.wav"), SOUND_MOVE);
|
menu->loadAudioFile(asset->get("sound_menu_move.wav"), SOUND_MOVE);
|
||||||
|
|
||||||
menu->init("TITLE", 0, 150, MENU_BACKGROUND_TRANSPARENT);
|
menu->init("TITLE", 0, 150, MENU_BACKGROUND_TRANSPARENT);
|
||||||
menu->addItem("START",2);
|
menu->addItem("START", 2);
|
||||||
menu->addItem("OPTIONS", 5);
|
menu->addItem("OPTIONS", 5);
|
||||||
menu->addItem("EXIT");
|
menu->addItem("EXIT");
|
||||||
menu->setDefaultActionWhenCancel(2);
|
menu->setDefaultActionWhenCancel(2);
|
||||||
menu->setBackgroundColor({0x30, 0x30, 0x40}, 192);
|
menu->setBackgroundColor({0x30, 0x30, 0x40}, 192);
|
||||||
menu->setSelectorColor({0xe5, 0x1c, 0x23}, 0);
|
menu->setSelectorColor({0xe5, 0x1c, 0x23}, 0);
|
||||||
@@ -103,6 +103,7 @@ void Title::update()
|
|||||||
}
|
}
|
||||||
sprite->animate();
|
sprite->animate();
|
||||||
menu->update();
|
menu->update();
|
||||||
|
checkMenu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,3 +140,23 @@ section_t Title::run()
|
|||||||
|
|
||||||
JA_StopMusic();
|
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
|
// Crea el menu
|
||||||
void initMenu();
|
void initMenu();
|
||||||
|
|
||||||
|
// Comprueba el menu
|
||||||
|
void checkMenu();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
Title(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input);
|
Title(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input);
|
||||||
|
|||||||
Reference in New Issue
Block a user