34 lines
881 B
C++
34 lines
881 B
C++
// puntuacio_flotant.hpp - Número de puntuació que apareix i desapareix
|
|
// © 2025 Port a C++20 amb SDL3
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include "core/types.hpp"
|
|
|
|
namespace Effects {
|
|
|
|
// PuntuacioFlotant: text animat que mostra punts guanyats
|
|
// S'activa quan es destrueix un enemic i s'esvaeix després d'un temps
|
|
struct PuntuacioFlotant {
|
|
// Text a mostrar (e.g., "100", "150", "200")
|
|
std::string text;
|
|
|
|
// Posició actual (coordenades mundials)
|
|
Punt posicio;
|
|
|
|
// Animació de moviment
|
|
Punt velocitat; // px/s (normalment cap amunt: {0.0f, -30.0f})
|
|
|
|
// Animació de fade
|
|
float temps_vida; // Temps transcorregut (segons)
|
|
float temps_max; // Temps de vida màxim (segons)
|
|
float brightness; // Brillantor calculada (0.0-1.0)
|
|
|
|
// Estat
|
|
bool actiu;
|
|
};
|
|
|
|
} // namespace Effects
|