treballant en el LOGO
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
// escena_logo.hpp - Pantalla d'inici del joc
|
||||
// Mostra pantalla negra durant 2 segons i salta al joc
|
||||
// Mostra logo JAILGAMES animat amb zoom i salta al joc
|
||||
// © 2025 Port a C++20
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../../core/rendering/sdl_manager.hpp"
|
||||
#include "../../core/graphics/shape.hpp"
|
||||
#include "../../core/types.hpp"
|
||||
#include <SDL3/SDL.h>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
class EscenaLogo {
|
||||
public:
|
||||
@@ -16,6 +20,25 @@ private:
|
||||
SDLManager& sdl_;
|
||||
float temps_acumulat_;
|
||||
|
||||
// Estructura per a cada lletra del logo
|
||||
struct LetraLogo {
|
||||
std::shared_ptr<Graphics::Shape> forma;
|
||||
Punt posicio; // Posició final en pantalla
|
||||
float ancho; // Ancho per a càlcul de centrat
|
||||
};
|
||||
|
||||
std::vector<LetraLogo> lletres_; // 9 lletres: J-A-I-L-G-A-M-E-S
|
||||
|
||||
// Constants d'animació
|
||||
static constexpr float DURACIO_ZOOM = 1.5f; // Duració del zoom (segons)
|
||||
static constexpr float DURACIO_TOTAL = 3.0f; // Duració total abans d'anar al joc
|
||||
static constexpr float ESCALA_INICIAL = 0.1f; // Escala inicial (10%)
|
||||
static constexpr float ESCALA_FINAL = 1.0f; // Escala final (100%)
|
||||
static constexpr float ESPAI_ENTRE_LLETRES = 10.0f; // Espaiat entre lletres
|
||||
|
||||
// Mètodes privats
|
||||
void inicialitzar_lletres();
|
||||
float calcular_escala_zoom(float temps) const;
|
||||
void actualitzar(float delta_time);
|
||||
void dibuixar();
|
||||
void processar_events(const SDL_Event& event);
|
||||
|
||||
Reference in New Issue
Block a user