intro acabada
This commit is contained in:
@@ -33,23 +33,24 @@ class CardSprite : public MovingSprite {
|
||||
void render() override;
|
||||
|
||||
// --- Control de estado ---
|
||||
void enable(); // Inicia la animación de entrada
|
||||
void startExit(); // Inicia la animación de salida
|
||||
auto enable() -> bool; // Inicia la animación de entrada (true si se activó)
|
||||
void startExit(); // Inicia la animación de salida
|
||||
|
||||
// --- Consultas de estado ---
|
||||
[[nodiscard]] auto hasLanded() const -> bool; // ¿Ha aterrizado definitivamente?
|
||||
[[nodiscard]] auto hasFirstTouch() const -> bool; // ¿Ha tocado la mesa por primera vez? (primer rebote)
|
||||
[[nodiscard]] auto hasFinished() const -> bool; // ¿Ha terminado completamente?
|
||||
[[nodiscard]] auto isExiting() const -> bool; // ¿Está saliendo de pantalla?
|
||||
[[nodiscard]] auto getState() const -> CardState; // Estado actual
|
||||
[[nodiscard]] auto hasLanded() const -> bool; // ¿Ha aterrizado definitivamente?
|
||||
[[nodiscard]] auto hasFirstTouch() const -> bool; // ¿Ha tocado la mesa por primera vez? (primer rebote)
|
||||
[[nodiscard]] auto hasFinished() const -> bool; // ¿Ha terminado completamente?
|
||||
[[nodiscard]] auto isExiting() const -> bool; // ¿Está saliendo de pantalla?
|
||||
[[nodiscard]] auto getState() const -> CardState; // Estado actual
|
||||
|
||||
// --- Configuración de entrada ---
|
||||
void setEntryParams(float start_zoom, double start_angle, float duration_s, std::function<double(double)> easing);
|
||||
void setEntryPosition(float start_x, float start_y); // Posición inicial (borde de pantalla)
|
||||
void setLandingPosition(float x, float y); // Posición final centrada
|
||||
void setLandingPosition(float x, float y); // Posición final centrada
|
||||
|
||||
// --- Configuración de salida ---
|
||||
void setExitParams(float vx, float vy, float ax, float ay, double rotate_amount);
|
||||
void setExitLift(float target_zoom, float zoom_speed); // Ganar altura al salir (zoom > 1.0)
|
||||
|
||||
// --- Sombra ---
|
||||
void setShadowTexture(std::shared_ptr<Texture> texture);
|
||||
@@ -72,8 +73,8 @@ class CardSprite : public MovingSprite {
|
||||
float entry_duration_s_ = 1.5F;
|
||||
float entry_elapsed_ = 0.0F;
|
||||
std::function<double(double)> entry_easing_;
|
||||
float entry_start_x_ = 0.0F; // Posición inicial X (borde)
|
||||
float entry_start_y_ = 0.0F; // Posición inicial Y (borde)
|
||||
float entry_start_x_ = 0.0F; // Posición inicial X (borde)
|
||||
float entry_start_y_ = 0.0F; // Posición inicial Y (borde)
|
||||
float landing_x_ = 0.0F;
|
||||
float landing_y_ = 0.0F;
|
||||
|
||||
@@ -83,6 +84,8 @@ class CardSprite : public MovingSprite {
|
||||
float exit_ax_ = 0.0F;
|
||||
float exit_ay_ = 0.0F;
|
||||
double exit_rotate_amount_ = 0.0;
|
||||
float exit_target_zoom_ = 1.0F; // Zoom objetivo al salir (>1.0 = se eleva)
|
||||
float exit_zoom_speed_ = 0.0F; // Velocidad de cambio de zoom por segundo
|
||||
|
||||
// --- Sombra ---
|
||||
std::shared_ptr<Texture> shadow_texture_;
|
||||
@@ -94,8 +97,9 @@ class CardSprite : public MovingSprite {
|
||||
float screen_width_ = 320.0F;
|
||||
float screen_height_ = 240.0F;
|
||||
|
||||
// --- Margen fuera de pantalla para considerar FINISHED ---
|
||||
static constexpr float OFF_SCREEN_MARGIN = 50.0F;
|
||||
// --- Constantes ---
|
||||
static constexpr float OFF_SCREEN_MARGIN = 50.0F; // Margen fuera de pantalla para considerar FINISHED
|
||||
static constexpr float SHADOW_HEIGHT_MULTIPLIER = 400.0F; // Pixels de separación de sombra por unidad de altura
|
||||
|
||||
// --- Métodos internos ---
|
||||
void updateEntering(float delta_time);
|
||||
|
||||
Reference in New Issue
Block a user