fix: arreglats mil mini bugs d'estes ultimes coses que he estat fent. El cas es que el joc es veu igual pero porte dos matins aci fent el mongol.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <cstdlib> // Para rand, size_t
|
||||
#include <functional> // Para function
|
||||
#include <iterator> // Para distance, size
|
||||
#include <iostream> // Para std::cout, std::endl
|
||||
|
||||
#include "asset.h" // Para Asset
|
||||
#include "audio.h" // Para Audio
|
||||
@@ -1744,11 +1745,8 @@ void Game::updateMenace() {
|
||||
|
||||
// Si el nivel de amenza es inferior al umbral
|
||||
if (menace_current_ < menace_threshold_) {
|
||||
// Crea una formación de enemigos
|
||||
balloon_manager_->deployBalloonFormation(Stage::number);
|
||||
|
||||
// Recalcula el nivel de amenaza con el nuevo globo
|
||||
evaluateAndSetMenace();
|
||||
balloon_manager_->deployRandomFormation(Stage::number); // Crea una formación aleatoria de globos
|
||||
evaluateAndSetMenace(); // Recalcula el nivel de amenaza con el nuevo globo
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1772,7 +1770,7 @@ void Game::checkAndUpdateBalloonSpeed() {
|
||||
if (balloon_manager_->getBalloonSpeed() == Balloon::SPEED.at(i) && PERCENT > THRESHOLDS.at(i)) {
|
||||
// Sube la velocidad al siguiente nivel (i + 1)
|
||||
balloon_manager_->setBalloonSpeed(Balloon::SPEED.at(i + 1));
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1835,6 +1833,7 @@ void Game::checkServiceMenu() {
|
||||
#ifdef _DEBUG
|
||||
// Comprueba los eventos en el modo DEBUG
|
||||
void Game::checkDebugEvents(const SDL_Event &event) {
|
||||
static int formation_id = 0;
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && static_cast<int>(event.key.repeat) == 0) {
|
||||
switch (event.key.key) {
|
||||
case SDLK_1: // Crea una powerball
|
||||
@@ -1896,6 +1895,20 @@ void Game::checkDebugEvents(const SDL_Event &event) {
|
||||
tabe_->enable();
|
||||
break;
|
||||
}
|
||||
case SDLK_KP_PLUS:{
|
||||
++formation_id;
|
||||
balloon_manager_->destroyAllBalloons();
|
||||
balloon_manager_->deployFormation(formation_id);
|
||||
std::cout << formation_id << std::endl;
|
||||
break;
|
||||
}
|
||||
case SDLK_KP_MINUS:{
|
||||
--formation_id;
|
||||
balloon_manager_->destroyAllBalloons();
|
||||
balloon_manager_->deployFormation(formation_id);
|
||||
std::cout << formation_id << std::endl;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ class Game {
|
||||
// bool paused_by_service_menu_ = false;
|
||||
float difficulty_score_multiplier_; // Multiplicador de puntos en función de la dificultad
|
||||
int counter_ = 0; // Contador para el juego
|
||||
int game_completed_counter_ = 0; // Contador para el tramo final, cuando se ha completado la partida y ya no aparecen más enemigos
|
||||
int game_completed_counter_ = 0; // Contador para el tramo final, cuando se ha completado la partida y ya no aparecen más globos
|
||||
int game_over_counter_ = GAME_OVER_COUNTER; // Contador para el estado de fin de partida
|
||||
int time_stopped_counter_ = 0; // Temporizador para llevar la cuenta del tiempo detenido
|
||||
int total_power_to_complete_game_; // La suma del poder necesario para completar todas las fases
|
||||
|
||||
@@ -111,7 +111,7 @@ void Instructions::updateSprites() {
|
||||
|
||||
// Rellena la textura de texto
|
||||
void Instructions::fillTexture() {
|
||||
const int DESP_X = param.game.item_size + 8;
|
||||
const int X_OFFSET = param.game.item_size + 8;
|
||||
|
||||
// Modifica el renderizador para pintar en la textura
|
||||
auto *temp = SDL_GetRenderTarget(renderer_);
|
||||
@@ -148,7 +148,7 @@ void Instructions::fillTexture() {
|
||||
const int L = text_->lenght(desc);
|
||||
lenght = L > lenght ? L : lenght;
|
||||
}
|
||||
const int ANCHOR_ITEM = (param.game.width - (lenght + DESP_X)) / 2;
|
||||
const int ANCHOR_ITEM = (param.game.width - (lenght + X_OFFSET)) / 2;
|
||||
|
||||
auto caption_style = TextStyle(ORANGE_TEXT_COLOR, SHADOW_TEXT_COLOR);
|
||||
auto text_style = TextStyle(NO_TEXT_COLOR, SHADOW_TEXT_COLOR);
|
||||
@@ -167,11 +167,11 @@ void Instructions::fillTexture() {
|
||||
text_->writeDX(TEXT_CENTER | TEXT_COLOR | TEXT_SHADOW, param.game.game_area.center_x, ANCHOR2, Lang::getText("[INSTRUCTIONS] 06"), caption_style);
|
||||
|
||||
const int ANCHOR3 = ANCHOR2 + SPACE_POST_HEADER;
|
||||
text_->writeShadowed(ANCHOR_ITEM + DESP_X, ANCHOR3 + SPACE_BETWEEN_ITEM_LINES * 0, Lang::getText("[INSTRUCTIONS] 07"), SHADOW_TEXT_COLOR);
|
||||
text_->writeShadowed(ANCHOR_ITEM + DESP_X, ANCHOR3 + SPACE_BETWEEN_ITEM_LINES * 1, Lang::getText("[INSTRUCTIONS] 08"), SHADOW_TEXT_COLOR);
|
||||
text_->writeShadowed(ANCHOR_ITEM + DESP_X, ANCHOR3 + SPACE_BETWEEN_ITEM_LINES * 2, Lang::getText("[INSTRUCTIONS] 09"), SHADOW_TEXT_COLOR);
|
||||
text_->writeShadowed(ANCHOR_ITEM + DESP_X, ANCHOR3 + SPACE_BETWEEN_ITEM_LINES * 3, Lang::getText("[INSTRUCTIONS] 10"), SHADOW_TEXT_COLOR);
|
||||
text_->writeShadowed(ANCHOR_ITEM + DESP_X, ANCHOR3 + SPACE_BETWEEN_ITEM_LINES * 4, Lang::getText("[INSTRUCTIONS] 11"), SHADOW_TEXT_COLOR);
|
||||
text_->writeShadowed(ANCHOR_ITEM + X_OFFSET, ANCHOR3 + SPACE_BETWEEN_ITEM_LINES * 0, Lang::getText("[INSTRUCTIONS] 07"), SHADOW_TEXT_COLOR);
|
||||
text_->writeShadowed(ANCHOR_ITEM + X_OFFSET, ANCHOR3 + SPACE_BETWEEN_ITEM_LINES * 1, Lang::getText("[INSTRUCTIONS] 08"), SHADOW_TEXT_COLOR);
|
||||
text_->writeShadowed(ANCHOR_ITEM + X_OFFSET, ANCHOR3 + SPACE_BETWEEN_ITEM_LINES * 2, Lang::getText("[INSTRUCTIONS] 09"), SHADOW_TEXT_COLOR);
|
||||
text_->writeShadowed(ANCHOR_ITEM + X_OFFSET, ANCHOR3 + SPACE_BETWEEN_ITEM_LINES * 3, Lang::getText("[INSTRUCTIONS] 10"), SHADOW_TEXT_COLOR);
|
||||
text_->writeShadowed(ANCHOR_ITEM + X_OFFSET, ANCHOR3 + SPACE_BETWEEN_ITEM_LINES * 4, Lang::getText("[INSTRUCTIONS] 11"), SHADOW_TEXT_COLOR);
|
||||
|
||||
// Deja el renderizador como estaba
|
||||
SDL_SetRenderTarget(renderer_, temp);
|
||||
|
||||
Reference in New Issue
Block a user