al acabar la partida i vore els records, torna al titol
This commit is contained in:
@@ -22,7 +22,6 @@ Fade::Fade()
|
|||||||
Fade::~Fade()
|
Fade::~Fade()
|
||||||
{
|
{
|
||||||
SDL_DestroyTexture(backbuffer_);
|
SDL_DestroyTexture(backbuffer_);
|
||||||
backbuffer_ = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inicializa las variables
|
// Inicializa las variables
|
||||||
@@ -141,11 +140,11 @@ void Fade::update()
|
|||||||
SDL_SetRenderDrawColor(renderer_, r_, g_, b_, a_);
|
SDL_SetRenderDrawColor(renderer_, r_, g_, b_, a_);
|
||||||
|
|
||||||
// Dibuja el cuadrado correspondiente
|
// Dibuja el cuadrado correspondiente
|
||||||
const int index = std::min(counter_ / fade_random_squares_delay_, (num_squares_width_ * num_squares_height_) - 1);
|
const int INDEX = std::min(counter_ / fade_random_squares_delay_, (num_squares_width_ * num_squares_height_) - 1);
|
||||||
for (int i = 0; i < fade_random_squares_mult_; ++i)
|
for (int i = 0; i < fade_random_squares_mult_; ++i)
|
||||||
{
|
{
|
||||||
const int index2 = std::min(index * fade_random_squares_mult_ + i, (int)square_.size() - 1);
|
const int INDEX2 = std::min(INDEX * fade_random_squares_mult_ + i, (int)square_.size() - 1);
|
||||||
SDL_RenderFillRect(renderer_, &square_[index2]);
|
SDL_RenderFillRect(renderer_, &square_[INDEX2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deja el renderizador como estaba
|
// Deja el renderizador como estaba
|
||||||
|
|||||||
@@ -346,6 +346,7 @@ void Game::updateGameStateGameOver()
|
|||||||
{
|
{
|
||||||
// La partida ha terminado con la derrota de los jugadores
|
// La partida ha terminado con la derrota de los jugadores
|
||||||
section::name = section::Name::HI_SCORE_TABLE;
|
section::name = section::Name::HI_SCORE_TABLE;
|
||||||
|
section::options = section::Options::HI_SCORE_AFTER_GAME_OVER;
|
||||||
}
|
}
|
||||||
if (options.audio.enabled)
|
if (options.audio.enabled)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -176,7 +176,10 @@ void HiScoreTable::updateFade()
|
|||||||
|
|
||||||
if (fade_->hasEnded() && fade_mode_ == FadeMode::OUT)
|
if (fade_->hasEnded() && fade_mode_ == FadeMode::OUT)
|
||||||
{
|
{
|
||||||
section::name = section::Name::INSTRUCTIONS;
|
section::name = (section::options == section::Options::HI_SCORE_AFTER_GAME_OVER)
|
||||||
|
? section::Name::TITLE
|
||||||
|
: section::Name::INSTRUCTIONS;
|
||||||
|
section::options = section::Options::NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ namespace section
|
|||||||
QUIT_WITH_CONTROLLER,
|
QUIT_WITH_CONTROLLER,
|
||||||
QUIT_FROM_EVENT,
|
QUIT_FROM_EVENT,
|
||||||
RELOAD,
|
RELOAD,
|
||||||
|
HI_SCORE_AFTER_GAME_OVER,
|
||||||
NONE,
|
NONE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user