Tabe: afegit a Param
This commit is contained in:
@@ -90,3 +90,7 @@ debug.color 00FFFF # Color para elementos de depuración
|
||||
# --- RESOURCE ---
|
||||
resource.color FFFFFF # Color de recurso 1
|
||||
resource.color FFFFFF # Color de recurso 2
|
||||
|
||||
# --- TABE ---
|
||||
tabe.min_spawn_time 2.0f # Tiempo mínimo en minutos para que aparezca el Tabe
|
||||
tabe.max_spawn_time 3.0f # Tiempo máximo en minutos para que aparezca el Tabe
|
||||
@@ -90,3 +90,7 @@ debug.color 00FFFF # Color para elementos de depuración
|
||||
# --- RESOURCE ---
|
||||
resource.color FFFFFF # Color de recurso 1
|
||||
resource.color FFFFFF # Color de recurso 2
|
||||
|
||||
# --- TABE ---
|
||||
tabe.min_spawn_time 2.0f # Tiempo mínimo en minutos para que aparezca el Tabe
|
||||
tabe.max_spawn_time 3.0f # Tiempo máximo en minutos para que aparezca el Tabe
|
||||
@@ -89,6 +89,10 @@ void initParam() {
|
||||
param.intro.card_color = Color::fromHex("CBDBFC");
|
||||
param.intro.shadow_color = Color::fromHex("00000080");
|
||||
param.intro.text_distance_from_bottom = 48;
|
||||
|
||||
// TABE
|
||||
param.tabe.min_spawn_time = 2.0F;
|
||||
param.tabe.max_spawn_time = 3.0F;
|
||||
}
|
||||
|
||||
// Carga los parámetros desde un archivo
|
||||
@@ -197,7 +201,9 @@ auto setParams(const std::string& var, const std::string& value) -> bool {
|
||||
{"balloon.settings[2].vel", [](const std::string& v) { param.balloon.settings.at(2).vel = std::stof(v); }},
|
||||
{"balloon.settings[2].grav", [](const std::string& v) { param.balloon.settings.at(2).grav = std::stof(v); }},
|
||||
{"balloon.settings[3].vel", [](const std::string& v) { param.balloon.settings.at(3).vel = std::stof(v); }},
|
||||
{"balloon.settings[3].grav", [](const std::string& v) { param.balloon.settings.at(3).grav = std::stof(v); }}};
|
||||
{"balloon.settings[3].grav", [](const std::string& v) { param.balloon.settings.at(3).grav = std::stof(v); }},
|
||||
{"tabe.min_spawn_time", [](const std::string& v) { param.tabe.min_spawn_time = std::stof(v); }},
|
||||
{"tabe.max_spawn_time", [](const std::string& v) { param.tabe.max_spawn_time = std::stof(v); }}};
|
||||
|
||||
static const std::unordered_map<std::string, std::function<void(const std::string&)>> STRING_PARAMS = {
|
||||
{"balloon.color[0]", [](const std::string& v) { param.balloon.color.at(0) = v; }},
|
||||
|
||||
@@ -112,6 +112,12 @@ struct ParamResource {
|
||||
Color color;
|
||||
};
|
||||
|
||||
// --- Parámetros para Tabe ---
|
||||
struct ParamTabe {
|
||||
float min_spawn_time;
|
||||
float max_spawn_time;
|
||||
};
|
||||
|
||||
// --- Estructura principal para almacenar todos los parámetros del juego ---
|
||||
struct Param {
|
||||
ParamGame game; // Parámetros del juego
|
||||
@@ -125,6 +131,7 @@ struct Param {
|
||||
ParamIntro intro; // Parámetros de la intro
|
||||
ParamDebug debug; // Parámetros para Debug
|
||||
ParamResource resource; // Parámetros para Resource
|
||||
ParamTabe tabe; // Parametros para Tabe
|
||||
|
||||
// Constructor
|
||||
Param()
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// Constructor
|
||||
Tabe::Tabe()
|
||||
: sprite_(std::make_unique<AnimatedSprite>(Resource::get()->getTexture("tabe.png"), Resource::get()->getAnimation("tabe.ani"))),
|
||||
timer_(Timer(2.5F, 4.0F)) {}
|
||||
timer_(Timer(param.tabe.min_spawn_time, param.tabe.max_spawn_time)) {}
|
||||
|
||||
// Actualiza la lógica
|
||||
void Tabe::update() {
|
||||
|
||||
Reference in New Issue
Block a user