Transició a surface: ending.cpp fet

This commit is contained in:
2025-03-03 20:48:31 +01:00
parent d7e0178602
commit b320030547
11 changed files with 128 additions and 134 deletions

View File

@@ -4,7 +4,7 @@
#include <memory> // for shared_ptr
#include <vector> // for vector
#include "utils.h" // for Color
class AnimatedSprite; // lines 8-8
class SAnimatedSprite; // lines 8-8
class GameOver
{
@@ -15,15 +15,15 @@ private:
static constexpr int COUNTER_FADE_LENGHT_ = 20; // Contador: duración del fade
// Objetos y punteros
std::shared_ptr<AnimatedSprite> player_sprite_; // Sprite con el jugador
std::shared_ptr<AnimatedSprite> tv_sprite_; // Sprite con el televisor
std::shared_ptr<SAnimatedSprite> player_sprite_; // Sprite con el jugador
std::shared_ptr<SAnimatedSprite> tv_sprite_; // Sprite con el televisor
// Variables
int pre_counter_ = 0; // Contador previo
int counter_ = 0; // Contador
Uint32 ticks_ = 0; // Contador de ticks para ajustar la velocidad del programa
std::vector<Color> colors_; // Vector con los colores para el fade
Color color_; // Color usado para el texto y los sprites
std::vector<Uint8> colors_; // Vector con los colores para el fade
Uint8 color_; // Color usado para el texto y los sprites
// Actualiza el objeto
void update();