- Comencem a implementar els menus

This commit is contained in:
2024-07-05 18:04:50 +02:00
parent 40a531f8b5
commit ee4d869ac9
4 changed files with 50 additions and 3 deletions

View File

@@ -5,10 +5,12 @@
#include "string.h"
#include "m_game.h"
#include "m_menu.h"
#include "m_logo.h"
#define M_LOGO 0
#define M_GAME 1
#define M_MENU 1
#define M_GAME 2
int current_module = M_LOGO;
void game::init()
@@ -32,7 +34,10 @@ bool game::loop()
switch(current_module)
{
case M_LOGO:
if (!modules::logo::loop()) { modules::game::init(); current_module = M_GAME; }
if (!modules::logo::loop()) { modules::menu::init(); current_module = M_MENU; }
break;
case M_MENU:
if (!modules::menu::loop()) { modules::game::init(); current_module = M_GAME; }
break;
case M_GAME:
return modules::game::loop();