Acabats els credits a 320x240 (i per extensió, a qualsevol resolució)
This commit is contained in:
@@ -151,7 +151,7 @@ void Balloon::move()
|
|||||||
// Colisión en las partes laterales de la zona de juego
|
// Colisión en las partes laterales de la zona de juego
|
||||||
const int clip = 2;
|
const int clip = 2;
|
||||||
const float min_x = play_area_.x - clip;
|
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)
|
if (x_ < min_x || x_ > max_x)
|
||||||
{
|
{
|
||||||
x_ = std::clamp(x_, min_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
|
// 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)
|
if (y_ > max_y)
|
||||||
{
|
{
|
||||||
y_ = max_y;
|
y_ = max_y;
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ void Credits::throwBalloons()
|
|||||||
if (counter_ % speed == 0)
|
if (counter_ % speed == 0)
|
||||||
{
|
{
|
||||||
const int index = (counter_ / speed) % sets.size();
|
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)
|
if (counter_ % (speed * 4) == 0 && counter_ > 0)
|
||||||
@@ -365,7 +365,7 @@ void Credits::initPlayers()
|
|||||||
|
|
||||||
// Crea los dos jugadores
|
// Crea los dos jugadores
|
||||||
constexpr int player_width = 30;
|
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 bool demo = false;
|
||||||
constexpr int away_distance = 700;
|
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));
|
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));
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ private:
|
|||||||
param.game.game_area.rect.x,
|
param.game.game_area.rect.x,
|
||||||
param.game.game_area.rect.y + black_bars_size_,
|
param.game.game_area.rect.y + black_bars_size_,
|
||||||
param.game.game_area.rect.w,
|
param.game.game_area.rect.w,
|
||||||
PLAY_AREA_HEIGHT}; // Area visible para los creditos
|
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
|
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 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 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
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user