diff --git a/source/balloon.cpp b/source/balloon.cpp index 1c70c9c..1121646 100644 --- a/source/balloon.cpp +++ b/source/balloon.cpp @@ -151,7 +151,7 @@ void Balloon::move() // Colisión en las partes laterales de la zona de juego const int clip = 2; const float min_x = play_area_.x - clip; - const float max_x = play_area_.w - w_ + clip; + const float max_x = play_area_.x + play_area_.w - w_ + clip; if (x_ < min_x || x_ > max_x) { x_ = std::clamp(x_, min_x, max_x); @@ -195,7 +195,7 @@ void Balloon::move() } // Colisión en la parte inferior de la zona de juego - const int max_y = play_area_.h - h_; + const int max_y = play_area_.y + play_area_.h - h_; if (y_ > max_y) { y_ = max_y; diff --git a/source/credits.cpp b/source/credits.cpp index 38320bb..632a323 100644 --- a/source/credits.cpp +++ b/source/credits.cpp @@ -326,7 +326,7 @@ void Credits::throwBalloons() if (counter_ % speed == 0) { const int index = (counter_ / speed) % sets.size(); - balloon_manager_->deploySet(sets.at(index), -50); + balloon_manager_->deploySet(sets.at(index), -60); } if (counter_ % (speed * 4) == 0 && counter_ > 0) @@ -365,7 +365,7 @@ void Credits::initPlayers() // Crea los dos jugadores constexpr int player_width = 30; - const int y = play_area_.h - player_width; + const int y = play_area_.y + play_area_.h - player_width; constexpr bool demo = false; constexpr int away_distance = 700; players_.emplace_back(std::make_unique(1, play_area_.x - away_distance - player_width, y, demo, play_area_, player_textures.at(0), player_animations)); diff --git a/source/credits.h b/source/credits.h index 8b6922a..0d5df16 100644 --- a/source/credits.h +++ b/source/credits.h @@ -46,8 +46,8 @@ private: param.game.game_area.rect.x, param.game.game_area.rect.y + black_bars_size_, param.game.game_area.rect.w, - PLAY_AREA_HEIGHT}; // Area visible para los creditos - SDL_Rect top_black_rect_ = {play_area_.x, 0, play_area_.w, black_bars_size_}; // Rectangulo negro superior + PLAY_AREA_HEIGHT}; // Area visible para los creditos + SDL_Rect top_black_rect_ = {play_area_.x, param.game.game_area.rect.y, play_area_.w, black_bars_size_}; // Rectangulo negro superior SDL_Rect bottom_black_rect_ = {play_area_.x, param.game.game_area.rect.h - black_bars_size_, play_area_.w, black_bars_size_}; // Rectangulo negro inferior SDL_Rect left_black_rect_ = {play_area_.x, param.game.game_area.center_y - 1, 0, 2}; // Rectangulo negro situado a la izquierda SDL_Rect right_black_rect_ = {play_area_.x + play_area_.w, param.game.game_area.center_y - 1, 0, 2}; // Rectangulo negro situado a la derecha