Trabajando el menu de game over y el player_fire
This commit is contained in:
@@ -212,12 +212,17 @@ void Game::init()
|
||||
difficultyScoreMultiplier = 0.5f;
|
||||
difficultyColor = {75, 105, 47};
|
||||
pauseMenu->setSelectorColor(difficultyColor, 255);
|
||||
// gameOverMenu->setSelectorTextColor(difficultyColor);
|
||||
gameOverMenu->setSelectorColor(difficultyColor, 255);
|
||||
break;
|
||||
|
||||
case DIFFICULTY_NORMAL:
|
||||
defaultEnemySpeed = BALLOON_SPEED_1;
|
||||
difficultyScoreMultiplier = 1.0f;
|
||||
difficultyColor = {46, 63, 71};
|
||||
difficultyColor = {255, 122, 0};
|
||||
pauseMenu->setSelectorColor(difficultyColor, 255);
|
||||
// gameOverMenu->setSelectorTextColor(difficultyColor);
|
||||
gameOverMenu->setSelectorColor(difficultyColor, 255);
|
||||
break;
|
||||
|
||||
case DIFFICULTY_HARD:
|
||||
@@ -225,6 +230,8 @@ void Game::init()
|
||||
difficultyScoreMultiplier = 1.5f;
|
||||
difficultyColor = {118, 66, 138};
|
||||
pauseMenu->setSelectorColor(difficultyColor, 255);
|
||||
// gameOverMenu->setSelectorTextColor(difficultyColor);
|
||||
gameOverMenu->setSelectorColor(difficultyColor, 255);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -425,6 +432,9 @@ void Game::loadMedia()
|
||||
LTexture *player1Death = new LTexture(renderer, asset->get("player_bal1_death.png"));
|
||||
player1Textures.push_back(player1Death);
|
||||
|
||||
LTexture *player1Fire = new LTexture(renderer, asset->get("player_bal1_fire.png"));
|
||||
player1Textures.push_back(player1Fire);
|
||||
|
||||
// Texturas - Player2
|
||||
LTexture *player2Head = new LTexture(renderer, asset->get("player_arounder_head.png"));
|
||||
player2Textures.push_back(player2Head);
|
||||
@@ -438,6 +448,9 @@ void Game::loadMedia()
|
||||
LTexture *player2Death = new LTexture(renderer, asset->get("player_arounder_death.png"));
|
||||
player2Textures.push_back(player2Death);
|
||||
|
||||
LTexture *player2Fire = new LTexture(renderer, asset->get("player_arounder_fire.png"));
|
||||
player1Textures.push_back(player2Fire);
|
||||
|
||||
// Animaciones -- Jugador
|
||||
std::vector<std::string> *playerHeadAnimation = new std::vector<std::string>;
|
||||
loadAnimations(asset->get("player_head.ani"), playerHeadAnimation);
|
||||
@@ -455,6 +468,10 @@ void Game::loadMedia()
|
||||
loadAnimations(asset->get("player_death.ani"), playerDeathAnimation);
|
||||
playerAnimations.push_back(playerDeathAnimation);
|
||||
|
||||
std::vector<std::string> *playerFireAnimation = new std::vector<std::string>;
|
||||
loadAnimations(asset->get("player_fire.ani"), playerFireAnimation);
|
||||
playerAnimations.push_back(playerFireAnimation);
|
||||
|
||||
// Animaciones -- Globos
|
||||
std::vector<std::string> *balloon1Animation = new std::vector<std::string>;
|
||||
loadAnimations(asset->get("balloon1.ani"), balloon1Animation);
|
||||
@@ -508,6 +525,9 @@ void Game::loadMedia()
|
||||
gameOverMenu = new Menu(renderer, asset, input, asset->get("gameover.men"));
|
||||
gameOverMenu->setItemCaption(0, lang->getText(48));
|
||||
gameOverMenu->setItemCaption(1, lang->getText(49));
|
||||
const int w = text->getCharacterSize() * lang->getText(45).length();
|
||||
gameOverMenu->setRectSize(w, 0);
|
||||
gameOverMenu->centerMenuOnX(199);
|
||||
pauseMenu = new Menu(renderer, asset, input, asset->get("pause.men"));
|
||||
pauseMenu->setItemCaption(0, lang->getText(46));
|
||||
pauseMenu->setItemCaption(1, lang->getText(47));
|
||||
@@ -1557,7 +1577,14 @@ std::string Game::updateScoreText(Uint32 num)
|
||||
void Game::renderScoreBoard()
|
||||
{
|
||||
// Dibuja el fondo del marcador
|
||||
SDL_SetRenderDrawColor(renderer, difficultyColor.r, difficultyColor.g, difficultyColor.b, 255);
|
||||
if (difficulty == DIFFICULTY_NORMAL)
|
||||
{ // Pone el color gris de siempre
|
||||
SDL_SetRenderDrawColor(renderer, 46, 63, 71, 255);
|
||||
}
|
||||
else
|
||||
{ // Pinta el fondo del marcador del color de la dificultad
|
||||
SDL_SetRenderDrawColor(renderer, difficultyColor.r, difficultyColor.g, difficultyColor.b, 255);
|
||||
}
|
||||
SDL_Rect rect = {0, 160, 256, 32};
|
||||
SDL_RenderFillRect(renderer, &rect);
|
||||
|
||||
@@ -3375,9 +3402,11 @@ void Game::runGameOverScreen()
|
||||
{
|
||||
// Game Over
|
||||
textBig->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y - (BLOCK * 6), lang->getText(43));
|
||||
// textBig->writeDX(TXT_CENTER | TXT_SHADOW, PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y - (BLOCK * 6), lang->getText(43), 1, {255, 255, 235}, 1, difficultyColor);
|
||||
|
||||
// Your Score
|
||||
text->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y - (BLOCK * 3), lang->getText(44) + std::to_string(players.at(0)->getScore()));
|
||||
// text->writeDX(TXT_CENTER | TXT_SHADOW, PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y - (BLOCK * 3), lang->getText(44) + std::to_string(players.at(0)->getScore()), 1, {255, 255, 235}, 1, difficultyColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3386,7 +3415,8 @@ void Game::runGameOverScreen()
|
||||
text->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y, lang->getText(78) + std::to_string(players.at(1)->getScore()));
|
||||
}
|
||||
// Continue?
|
||||
text->writeCentered(99, PLAY_AREA_CENTER_Y + BLOCK * 2, lang->getText(45));
|
||||
text->writeCentered(199, PLAY_AREA_CENTER_Y + BLOCK * 3, lang->getText(45));
|
||||
// text->writeDX(TXT_CENTER | TXT_SHADOW, 199, PLAY_AREA_CENTER_Y + BLOCK * 3, lang->getText(45), 1, {255, 255, 235}, 1, difficultyColor);
|
||||
gameOverMenu->render();
|
||||
fade->render();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user