- [NEW] Cat's Life

This commit is contained in:
2024-07-25 10:16:57 +02:00
parent 1f6ce61ee2
commit 8c8449fb16
10 changed files with 107 additions and 10 deletions

View File

@@ -8,11 +8,15 @@
#include "config.h"
#include <SDL2/SDL.h>
#include "actor.h"
#include "room.h"
#include "m_game.h"
#include "m_menu.h"
#include "m_logo.h"
#include "m_ingame.h"
#include "m_gameover.h"
#include "m_catslife.h"
#include "m_menu_tecles.h"
#include "m_menu_audio.h"
@@ -21,8 +25,9 @@
#define M_GAME 2
#define M_INGAME 3
#define M_GAMEOVER 4
#define M_MENU_TECLES 5
#define M_MENU_AUDIO 6
#define M_CATSLIFE 5
#define M_MENU_TECLES 6
#define M_MENU_AUDIO 7
int current_module = M_LOGO;
int zoom = 3;
@@ -124,7 +129,11 @@ bool game::loop()
modules::ingame::init(); current_module = M_INGAME;
}
} else if (option==GAME_DEAD) {
modules::gameover::init(); current_module = M_GAMEOVER;
if (actor::stats::catsLife()) {
modules::catslife::init(); current_module = M_CATSLIFE;
} else {
modules::gameover::init(); current_module = M_GAMEOVER;
}
}
}
break;
@@ -140,6 +149,14 @@ bool game::loop()
modules::menu::init(); current_module = M_MENU;
}
break;
case M_CATSLIFE:
if (!modules::catslife::loop()) {
actor::hero::init(false);
actor::hero::setLives(1);
room::reload();
current_module = M_GAME;
}
break;
case M_MENU_TECLES:
if (modules::menu_tecles::loop() == MENU_TECLES_TORNAR) {
modules::menu::init(); current_module = M_MENU;