forked from jaildesigner-jailgames/jaildoctors_dilemma
En la pantalla de Game Over se muestran las habitaciones y los items conseguidos
This commit is contained in:
20
jaildoctors_dilemma_debug.dSYM/Contents/Info.plist
Normal file
20
jaildoctors_dilemma_debug.dSYM/Contents/Info.plist
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>English</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>com.apple.xcode.dsym.jaildoctors_dilemma_debug</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>dSYM</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -86,6 +86,8 @@ struct options_t
|
|||||||
palette_e palette; // Paleta de colores a usar en el juego
|
palette_e palette; // Paleta de colores a usar en el juego
|
||||||
bool console; // Indica si ha de mostrar información por la consola de texto
|
bool console; // Indica si ha de mostrar información por la consola de texto
|
||||||
cheat_t cheat; // Contiene trucos y ventajas para el juego
|
cheat_t cheat; // Contiene trucos y ventajas para el juego
|
||||||
|
int rooms; // Cantidad de habitaciones visitadas
|
||||||
|
int items; // Cantidad de items obtenidos
|
||||||
};
|
};
|
||||||
|
|
||||||
// Calcula el cuadrado de la distancia entre dos puntos
|
// Calcula el cuadrado de la distancia entre dos puntos
|
||||||
|
|||||||
@@ -91,6 +91,8 @@ void Director::iniOptions()
|
|||||||
options->cheat.invincible = false;
|
options->cheat.invincible = false;
|
||||||
options->cheat.jailEnabled = false;
|
options->cheat.jailEnabled = false;
|
||||||
options->cheat.altSkin = false;
|
options->cheat.altSkin = false;
|
||||||
|
options->rooms = 0;
|
||||||
|
options->items = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comprueba los parametros del programa
|
// Comprueba los parametros del programa
|
||||||
|
|||||||
@@ -340,6 +340,7 @@ bool Game::changeRoom(std::string file)
|
|||||||
{
|
{
|
||||||
// Incrementa el contador de habitaciones visitadas
|
// Incrementa el contador de habitaciones visitadas
|
||||||
board.rooms++;
|
board.rooms++;
|
||||||
|
options->rooms = board.rooms;
|
||||||
|
|
||||||
// Actualiza las estadisticas
|
// Actualiza las estadisticas
|
||||||
stats->addVisit(room->getName());
|
stats->addVisit(room->getName());
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ GameOver::GameOver(SDL_Renderer *renderer, Screen *screen, Resource *resource, A
|
|||||||
iniFade = 310;
|
iniFade = 310;
|
||||||
fadeLenght = 20;
|
fadeLenght = 20;
|
||||||
playerSprite->setPosX(GAMECANVAS_CENTER_X + 10);
|
playerSprite->setPosX(GAMECANVAS_CENTER_X + 10);
|
||||||
playerSprite->setPosY(GAMECANVAS_CENTER_Y + 10);
|
playerSprite->setPosY(GAMECANVAS_CENTER_Y - 10);
|
||||||
tvSprite->setPosX(GAMECANVAS_CENTER_X - tvSprite->getAnimationClip(0, 0).w - 10);
|
tvSprite->setPosX(GAMECANVAS_CENTER_X - tvSprite->getAnimationClip(0, 0).w - 10);
|
||||||
tvSprite->setPosY(GAMECANVAS_CENTER_Y + 10);
|
tvSprite->setPosY(GAMECANVAS_CENTER_Y - 10);
|
||||||
|
|
||||||
// Inicializa el vector de colores
|
// Inicializa el vector de colores
|
||||||
const std::vector<std::string> colorList = {"white", "yellow", "cyan", "green", "magenta", "red", "blue", "black"};
|
const std::vector<std::string> colorList = {"white", "yellow", "cyan", "green", "magenta", "red", "blue", "black"};
|
||||||
@@ -86,12 +86,17 @@ void GameOver::render()
|
|||||||
screen->clean();
|
screen->clean();
|
||||||
|
|
||||||
// Escribe el texto de GAME OVER
|
// Escribe el texto de GAME OVER
|
||||||
text->writeDX(TXT_CENTER | TXT_COLOR, GAMECANVAS_CENTER_X, GAMECANVAS_CENTER_Y - 20, "G A M E O V E R", 1, color);
|
text->writeDX(TXT_CENTER | TXT_COLOR, GAMECANVAS_CENTER_X, GAMECANVAS_CENTER_Y - 40, "G A M E O V E R", 1, color);
|
||||||
|
|
||||||
// Dibuja los sprites
|
// Dibuja los sprites
|
||||||
renderSprites();
|
renderSprites();
|
||||||
|
|
||||||
// text->write(0, 0, std::to_string(counter));
|
// Escribe el texto con las habitaciones y los items
|
||||||
|
const std::string itemsTxt = std::to_string(options->items / 100) + std::to_string((options->items % 100) / 10) + std::to_string(options->items % 10);
|
||||||
|
const std::string roomsTxt = std::to_string(options->rooms / 100) + std::to_string((options->rooms % 100) / 10) + std::to_string(options->rooms % 10);
|
||||||
|
text->writeDX(TXT_CENTER | TXT_COLOR, GAMECANVAS_CENTER_X, GAMECANVAS_CENTER_Y + 40, "ITEMS: " + itemsTxt, 1, color);
|
||||||
|
text->writeDX(TXT_CENTER | TXT_COLOR, GAMECANVAS_CENTER_X, GAMECANVAS_CENTER_Y + 55, "ROOMS: " + roomsTxt, 1, color);
|
||||||
|
|
||||||
|
|
||||||
// Vuelca el contenido del renderizador en pantalla
|
// Vuelca el contenido del renderizador en pantalla
|
||||||
screen->blit();
|
screen->blit();
|
||||||
@@ -180,7 +185,7 @@ void GameOver::updateColor()
|
|||||||
|
|
||||||
if (counter < half)
|
if (counter < half)
|
||||||
{
|
{
|
||||||
//const float step = std::min(std::max(counter, iniFade) - iniFade, fadeLenght) / (float)fadeLenght;
|
// const float step = std::min(std::max(counter, iniFade) - iniFade, fadeLenght) / (float)fadeLenght;
|
||||||
const float step = std::min(counter, fadeLenght) / (float)fadeLenght;
|
const float step = std::min(counter, fadeLenght) / (float)fadeLenght;
|
||||||
const int index = (colors.size() - 1) - int((colors.size() - 1) * step);
|
const int index = (colors.size() - 1) - int((colors.size() - 1) * step);
|
||||||
color = colors.at(index);
|
color = colors.at(index);
|
||||||
|
|||||||
@@ -824,6 +824,7 @@ bool Room::itemCollision(SDL_Rect &rect)
|
|||||||
items.erase(items.begin() + i);
|
items.erase(items.begin() + i);
|
||||||
JA_PlaySound(itemSound);
|
JA_PlaySound(itemSound);
|
||||||
*itemsPicked = *itemsPicked + 1;
|
*itemsPicked = *itemsPicked + 1;
|
||||||
|
options->items = *itemsPicked;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user