Acabats els credits a 320x240 (i per extensió, a qualsevol resolució)

This commit is contained in:
2024-12-03 10:51:19 +01:00
parent ab45c984a2
commit 1aa0dd3864
3 changed files with 6 additions and 6 deletions

View File

@@ -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;

View File

@@ -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<Player>(1, play_area_.x - away_distance - player_width, y, demo, play_area_, player_textures.at(0), player_animations));

View File

@@ -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