forked from jaildesigner-jailgames/jaildoctors_dilemma
Añadidos defines para RELEASE y MACOS_BUNDLE
This commit is contained in:
@@ -7,6 +7,9 @@
|
|||||||
#ifndef CONST_H
|
#ifndef CONST_H
|
||||||
#define CONST_H
|
#define CONST_H
|
||||||
|
|
||||||
|
//#define MACOS_BUNDLE
|
||||||
|
//#define RELEASE
|
||||||
|
|
||||||
// Textos
|
// Textos
|
||||||
#define WINDOW_CAPTION "JailDoctor's Dilemma"
|
#define WINDOW_CAPTION "JailDoctor's Dilemma"
|
||||||
#define TEXT_COPYRIGHT "@2022 JailDesigner"
|
#define TEXT_COPYRIGHT "@2022 JailDesigner"
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ Director::Director(int argc, char *argv[])
|
|||||||
section.name = SECTION_PROG_LOGO;
|
section.name = SECTION_PROG_LOGO;
|
||||||
section.subsection = SUBSECTION_LOGO_TO_INTRO;
|
section.subsection = SUBSECTION_LOGO_TO_INTRO;
|
||||||
|
|
||||||
section.name = SECTION_PROG_LOGO;
|
#ifndef RELEASE
|
||||||
|
section.name = SECTION_PROG_GAME;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Crea e inicializa las opciones del programa
|
// Crea e inicializa las opciones del programa
|
||||||
iniOptions();
|
iniOptions();
|
||||||
@@ -966,11 +968,12 @@ bool Director::initSDL()
|
|||||||
// Crea el indice de ficheros
|
// Crea el indice de ficheros
|
||||||
bool Director::setFileList()
|
bool Director::setFileList()
|
||||||
{
|
{
|
||||||
std::string prefix = "";
|
|
||||||
#define _MACOS_BUNDLE
|
|
||||||
#ifdef MACOS_BUNDLE
|
#ifdef MACOS_BUNDLE
|
||||||
prefix = "/../Resources";
|
const std::string prefix = "/../Resources";
|
||||||
|
#else
|
||||||
|
const std::string prefix = "";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Texto
|
// Texto
|
||||||
asset->add(prefix + "/data/font/smb2.png", t_font);
|
asset->add(prefix + "/data/font/smb2.png", t_font);
|
||||||
asset->add(prefix + "/data/font/smb2.txt", t_font);
|
asset->add(prefix + "/data/font/smb2.txt", t_font);
|
||||||
|
|||||||
@@ -18,12 +18,12 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *as
|
|||||||
this->debug = debug;
|
this->debug = debug;
|
||||||
this->options = options;
|
this->options = options;
|
||||||
|
|
||||||
// ****
|
#ifndef RELEASE
|
||||||
currentRoom = "03.room";
|
currentRoom = "03.room";
|
||||||
const int x = 29;
|
const int x = 29;
|
||||||
const int y = 13;
|
const int y = 13;
|
||||||
spawnPoint = {x * 8, y * 8, 0, 0, 0, s_standing, SDL_FLIP_HORIZONTAL};
|
spawnPoint = {x * 8, y * 8, 0, 0, 0, s_standing, SDL_FLIP_HORIZONTAL};
|
||||||
// ****
|
#endif
|
||||||
|
|
||||||
// Crea los objetos
|
// Crea los objetos
|
||||||
scoreboard = new ScoreBoard(renderer, resource, asset, options, &board);
|
scoreboard = new ScoreBoard(renderer, resource, asset, options, &board);
|
||||||
@@ -92,7 +92,7 @@ void Game::checkEventHandler()
|
|||||||
case SDL_SCANCODE_ESCAPE:
|
case SDL_SCANCODE_ESCAPE:
|
||||||
section.name = SECTION_PROG_TITLE;
|
section.name = SECTION_PROG_TITLE;
|
||||||
break;
|
break;
|
||||||
|
#ifndef RELEASE
|
||||||
case SDL_SCANCODE_G:
|
case SDL_SCANCODE_G:
|
||||||
debug->switchEnabled();
|
debug->switchEnabled();
|
||||||
options->cheat.invincible = debug->getEnabled();
|
options->cheat.invincible = debug->getEnabled();
|
||||||
@@ -104,26 +104,30 @@ void Game::checkEventHandler()
|
|||||||
resource->reLoad();
|
resource->reLoad();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SDL_SCANCODE_W:
|
||||||
|
goToRoom(BORDER_TOP);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_SCANCODE_A:
|
||||||
|
goToRoom(BORDER_LEFT);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_SCANCODE_S:
|
||||||
|
goToRoom(BORDER_BOTTOM);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SDL_SCANCODE_D:
|
||||||
|
goToRoom(BORDER_RIGHT);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case SDL_SCANCODE_M:
|
case SDL_SCANCODE_M:
|
||||||
board.music = !board.music;
|
board.music = !board.music;
|
||||||
board.music ? JA_ResumeMusic() : JA_PauseMusic();
|
board.music ? JA_ResumeMusic() : JA_PauseMusic();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_P:
|
case SDL_SCANCODE_P:
|
||||||
if (paused)
|
switchPause();
|
||||||
{
|
|
||||||
player->resume();
|
|
||||||
room->resume();
|
|
||||||
scoreboard->resume();
|
|
||||||
paused = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player->pause();
|
|
||||||
room->pause();
|
|
||||||
scoreboard->pause();
|
|
||||||
paused = true;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_B:
|
case SDL_SCANCODE_B:
|
||||||
@@ -160,22 +164,6 @@ void Game::checkEventHandler()
|
|||||||
switchPalette();
|
switchPalette();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_W:
|
|
||||||
goToRoom(BORDER_TOP);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SDL_SCANCODE_A:
|
|
||||||
goToRoom(BORDER_LEFT);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SDL_SCANCODE_S:
|
|
||||||
goToRoom(BORDER_BOTTOM);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SDL_SCANCODE_D:
|
|
||||||
goToRoom(BORDER_RIGHT);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -559,4 +547,23 @@ void Game::goToRoom(int border)
|
|||||||
{
|
{
|
||||||
currentRoom = roomName;
|
currentRoom = roomName;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pone el juego en pausa
|
||||||
|
void Game::switchPause()
|
||||||
|
{
|
||||||
|
if (paused)
|
||||||
|
{
|
||||||
|
player->resume();
|
||||||
|
room->resume();
|
||||||
|
scoreboard->resume();
|
||||||
|
paused = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player->pause();
|
||||||
|
room->pause();
|
||||||
|
scoreboard->pause();
|
||||||
|
paused = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -120,6 +120,9 @@ private:
|
|||||||
// Va a la habitación designada
|
// Va a la habitación designada
|
||||||
void goToRoom(int border);
|
void goToRoom(int border);
|
||||||
|
|
||||||
|
// Pone el juego en pausa
|
||||||
|
void switchPause();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, options_t *options, Input *input, Debug *debug);
|
Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, options_t *options, Input *input, Debug *debug);
|
||||||
|
|||||||
Reference in New Issue
Block a user