Merge branch 'main' of https://gitea.sustancia.synology.me/JailDesigner/coffee_crisis_arcade_edition
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
frame_width=10
|
frame_width=16
|
||||||
frame_height=10
|
frame_height=16
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=orange
|
name=orange
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
frame_width=16
|
frame_width=26
|
||||||
frame_height=16
|
frame_height=26
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=orange
|
name=orange
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
frame_width=26
|
frame_width=48
|
||||||
frame_height=26
|
frame_height=48
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=orange
|
name=orange
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
frame_width=10
|
frame_width=16
|
||||||
frame_height=10
|
frame_height=16
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=default
|
name=default
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
frame_width=16
|
frame_width=26
|
||||||
frame_height=16
|
frame_height=26
|
||||||
|
|
||||||
[animation]
|
[animation]
|
||||||
name=default
|
name=default
|
||||||
|
|||||||
@@ -32,10 +32,6 @@ class Balloon {
|
|||||||
static constexpr float VELX_POSITIVE = 0.7F;
|
static constexpr float VELX_POSITIVE = 0.7F;
|
||||||
static constexpr float VELX_NEGATIVE = -0.7F;
|
static constexpr float VELX_NEGATIVE = -0.7F;
|
||||||
|
|
||||||
static constexpr int MOVING_ANIMATION = 0;
|
|
||||||
static constexpr int POP_ANIMATION = 1;
|
|
||||||
static constexpr int BORN_ANIMATION = 2;
|
|
||||||
|
|
||||||
static constexpr std::array<float, 5> SPEED = {0.60F, 0.70F, 0.80F, 0.90F, 1.00F};
|
static constexpr std::array<float, 5> SPEED = {0.60F, 0.70F, 0.80F, 0.90F, 1.00F};
|
||||||
|
|
||||||
static constexpr int POWERBALL_SCREENPOWER_MINIMUM = 10;
|
static constexpr int POWERBALL_SCREENPOWER_MINIMUM = 10;
|
||||||
|
|||||||
@@ -22,6 +22,12 @@ BalloonManager::BalloonManager()
|
|||||||
|
|
||||||
// Inicializa
|
// Inicializa
|
||||||
void BalloonManager::init() {
|
void BalloonManager::init() {
|
||||||
|
// Limpia
|
||||||
|
balloon_textures_.clear();
|
||||||
|
balloon_animations_.clear();
|
||||||
|
explosions_textures_.clear();
|
||||||
|
explosions_animations_.clear();
|
||||||
|
|
||||||
// Texturas - Globos
|
// Texturas - Globos
|
||||||
balloon_textures_.emplace_back(Resource::get()->getTexture("balloon0.png"));
|
balloon_textures_.emplace_back(Resource::get()->getTexture("balloon0.png"));
|
||||||
balloon_textures_.emplace_back(Resource::get()->getTexture("balloon1.png"));
|
balloon_textures_.emplace_back(Resource::get()->getTexture("balloon1.png"));
|
||||||
@@ -49,10 +55,10 @@ void BalloonManager::init() {
|
|||||||
explosions_animations_.emplace_back(Resource::get()->getAnimation("explosion3.ani"));
|
explosions_animations_.emplace_back(Resource::get()->getAnimation("explosion3.ani"));
|
||||||
|
|
||||||
// Añade texturas
|
// Añade texturas
|
||||||
explosions_->addTexture(0, explosions_textures_[0], explosions_animations_[0]);
|
explosions_->addTexture(0, explosions_textures_.at(0), explosions_animations_.at(0));
|
||||||
explosions_->addTexture(1, explosions_textures_[1], explosions_animations_[1]);
|
explosions_->addTexture(1, explosions_textures_.at(1), explosions_animations_.at(1));
|
||||||
explosions_->addTexture(2, explosions_textures_[2], explosions_animations_[2]);
|
explosions_->addTexture(2, explosions_textures_.at(2), explosions_animations_.at(2));
|
||||||
explosions_->addTexture(3, explosions_textures_[3], explosions_animations_[3]);
|
explosions_->addTexture(3, explosions_textures_.at(3), explosions_animations_.at(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actualiza
|
// Actualiza
|
||||||
@@ -121,8 +127,8 @@ void BalloonManager::deploySet(int set_number) {
|
|||||||
const auto SET = balloon_formations_->getSet(set_number);
|
const auto SET = balloon_formations_->getSet(set_number);
|
||||||
const auto NUM_ENEMIES = SET.number_of_balloons;
|
const auto NUM_ENEMIES = SET.number_of_balloons;
|
||||||
for (int i = 0; i < NUM_ENEMIES; ++i) {
|
for (int i = 0; i < NUM_ENEMIES; ++i) {
|
||||||
auto p = SET.init[i];
|
auto balloon = SET.init[i];
|
||||||
createBalloon(p.x, p.y, p.type, p.size, p.vel_x, balloon_speed_, p.creation_counter);
|
createBalloon(balloon.x, balloon.y, balloon.type, balloon.size, balloon.vel_x, balloon_speed_, balloon.creation_counter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,8 +137,8 @@ void BalloonManager::deploySet(int set_number, int y) {
|
|||||||
const auto SET = balloon_formations_->getSet(set_number);
|
const auto SET = balloon_formations_->getSet(set_number);
|
||||||
const auto NUM_ENEMIES = SET.number_of_balloons;
|
const auto NUM_ENEMIES = SET.number_of_balloons;
|
||||||
for (int i = 0; i < NUM_ENEMIES; ++i) {
|
for (int i = 0; i < NUM_ENEMIES; ++i) {
|
||||||
auto p = SET.init[i];
|
auto balloon = SET.init[i];
|
||||||
createBalloon(p.x, y, p.type, p.size, p.vel_x, balloon_speed_, p.creation_counter);
|
createBalloon(balloon.x, y, balloon.type, balloon.size, balloon.vel_x, balloon_speed_, balloon.creation_counter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
// IWYU pragma: no_include <bits/std_abs.h>
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <SDL3/SDL.h> // Para Uint8
|
#include <SDL3/SDL.h> // Para Uint8
|
||||||
#include <bits/std_abs.h> // Para abs
|
|
||||||
|
|
||||||
#include <algorithm> // Para max, min
|
#include <algorithm> // Para max, min
|
||||||
#include <array> // Para array
|
#include <array> // Para array
|
||||||
|
|||||||
@@ -1768,9 +1768,11 @@ void Game::checkAndUpdateBalloonSpeed() {
|
|||||||
constexpr std::array<float, 4> THRESHOLDS = {0.2F, 0.4F, 0.6F, 0.8F};
|
constexpr std::array<float, 4> THRESHOLDS = {0.2F, 0.4F, 0.6F, 0.8F};
|
||||||
|
|
||||||
for (size_t i = 0; i < std::size(THRESHOLDS); ++i) {
|
for (size_t i = 0; i < std::size(THRESHOLDS); ++i) {
|
||||||
if (balloon_manager_->getBalloonSpeed() == Balloon::SPEED.at(i) && PERCENT > THRESHOLDS[i]) {
|
// Si la velocidad actual del globo es la correspondiente al umbral "i" y el porcentaje de progreso ha superado ese umbral
|
||||||
|
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));
|
balloon_manager_->setBalloonSpeed(Balloon::SPEED.at(i + 1));
|
||||||
break; // Salir del bucle una vez actualizada la velocidad y aplicada
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user