Trabajando en hacer que puedas entrar a la jail

This commit is contained in:
2022-11-05 20:56:09 +01:00
parent 1bcdadb6c0
commit 45fc923be9
10 changed files with 248 additions and 110 deletions

View File

@@ -45,16 +45,14 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *as
board.lives = 9;
board.items = 0;
board.rooms = 1;
const color_t c = room->getBorderColor();
board.color = (c.r + c.g + c.b == 0) ? stringToColor(options->palette, "white") : c; // Si el color es negro lo cambia a blanco
setScoreBoardColor();
board.music = true;
board.jailEnabled = false;
roomTracker->addRoom(currentRoom);
paused = false;
blackScreen = false;
blackScreenCounter = 0;
// this->player->setInvincible(debug->getEnabled());
// board.music = !debug->getEnabled();
section.name = SECTION_PROG_GAME;
section.subsection = 0;
}
@@ -503,10 +501,16 @@ void Game::setScoreBoardColor()
// Comprueba si ha finalizado el juego
bool Game::checkEndGame()
{
const bool a = room->getName() == "THE JAIL";
const bool b = board.items >= 2;
const bool b = board.items >= 5;
const bool c = player->getRect().x < 152;
if (b)
{
board.jailEnabled = true;
}
if (a && b && c)
{
section.name = SECTION_PROG_ENDING;