forked from jaildesigner-jailgames/jaildoctors_dilemma
Añadidos colores para el jugador segun los trucos. Añadida skin alternativa para el jugador
This commit is contained in:
@@ -67,6 +67,7 @@ struct cheat_t
|
||||
bool infiniteLives; // Indica si el jugador dispone de vidas infinitas
|
||||
bool invincible; // Indica si el jugador puede morir
|
||||
bool jailEnabled; // Indica si la Jail está abierta
|
||||
bool altSkin; // Indicxa si se usa una skin diferente para el jugador
|
||||
};
|
||||
|
||||
// Estructura con todas las opciones de configuración del programa
|
||||
|
||||
@@ -90,6 +90,7 @@ void Director::iniOptions()
|
||||
options->cheat.infiniteLives = false;
|
||||
options->cheat.invincible = false;
|
||||
options->cheat.jailEnabled = false;
|
||||
options->cheat.altSkin = false;
|
||||
}
|
||||
|
||||
// Comprueba los parametros del programa
|
||||
@@ -120,6 +121,11 @@ void Director::checkProgramArguments(int argc, char *argv[])
|
||||
{
|
||||
options->cheat.jailEnabled = true;
|
||||
}
|
||||
|
||||
else if (strcmp(argv[i], "--altSkin") == 0)
|
||||
{
|
||||
options->cheat.altSkin = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,9 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *as
|
||||
itemTracker = new ItemTracker();
|
||||
roomTracker = new RoomTracker();
|
||||
room = new Room(resource->getRoom(currentRoom), renderer, screen, asset, options, itemTracker, &board.items, false, debug);
|
||||
const player_t player = {spawnPoint, "player.png", "player.ani", renderer, resource, asset, options, input, room, debug};
|
||||
const std::string playerPNG = options->cheat.altSkin ? "player2.png" : "player.png";
|
||||
const std::string playerANI = options->cheat.altSkin ? "player2.ani" : "player.ani";
|
||||
const player_t player = {spawnPoint, playerPNG, playerANI, renderer, resource, asset, options, input, room, debug};
|
||||
this->player = new Player(player);
|
||||
eventHandler = new SDL_Event();
|
||||
text = new Text(resource->getOffset("smb2.txt"), resource->getTexture("smb2.png"), renderer);
|
||||
@@ -408,7 +410,9 @@ void Game::killPlayer()
|
||||
|
||||
// Crea la nueva habitación y el nuevo jugador
|
||||
room = new Room(resource->getRoom(currentRoom), renderer, screen, asset, options, itemTracker, &board.items, board.jailEnabled, debug);
|
||||
const player_t player = {spawnPoint, "player.png", "player.ani", renderer, resource, asset, options, input, room, debug};
|
||||
const std::string playerPNG = options->cheat.altSkin ? "player2.png" : "player.png";
|
||||
const std::string playerANI = options->cheat.altSkin ? "player2.ani" : "player.ani";
|
||||
const player_t player = {spawnPoint, playerPNG, playerANI, renderer, resource, asset, options, input, room, debug};
|
||||
this->player = new Player(player);
|
||||
|
||||
// Pone los objetos en pausa mientras esta la habitación en negro
|
||||
|
||||
@@ -19,6 +19,14 @@ Player::Player(player_t player)
|
||||
|
||||
// Inicializa variables
|
||||
color = stringToColor(options->palette, "white");
|
||||
if (options->cheat.infiniteLives)
|
||||
{
|
||||
color = stringToColor(options->palette, "yellow");
|
||||
}
|
||||
if (options->cheat.invincible)
|
||||
{
|
||||
color = stringToColor(options->palette, "cyan");
|
||||
}
|
||||
onBorder = false;
|
||||
border = BORDER_TOP;
|
||||
autoMovement = false;
|
||||
|
||||
Reference in New Issue
Block a user