Ja es pot "enner llour neim". Falta decidir quin de tots els dissenys m'agrada mes

This commit is contained in:
2024-09-29 22:25:31 +02:00
parent edc45b6cec
commit 2d5859b1c4
9 changed files with 327 additions and 99 deletions

View File

@@ -1,11 +1,11 @@
#pragma once
#include <SDL2/SDL_rect.h> // for SDL_Point, SDL_Rect
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
#include <SDL2/SDL_stdinc.h> // for Uint32
#include <string> // for string, basic_string
#include <vector> // for vector
#include "utils.h" // for color_t
#include <SDL2/SDL_rect.h> // for SDL_Point, SDL_Rect
#include <SDL2/SDL_render.h> // for SDL_Renderer, SDL_Texture
#include <SDL2/SDL_stdinc.h> // for Uint32
#include <string> // for string, basic_string
#include <vector> // for vector
#include "utils.h" // for color_t
class Asset;
class Sprite;
class Text;
@@ -52,22 +52,25 @@ private:
std::vector<SDL_Texture *> panelTexture; // Texturas para dibujar cada panel;
// Variables
int stage; // Número de fase actual
std::string name[SCOREBOARD_MAX_PANELS]; // Nom de cada jugador
int score[SCOREBOARD_MAX_PANELS]; // Puntuación de los jugadores
float mult[SCOREBOARD_MAX_PANELS]; // Multiplicador de los jugadores
int continueCounter[SCOREBOARD_MAX_PANELS]; // Tiempo para continuar de los jugadores
int hiScore; // Máxima puntuación
float power; // Poder actual de la fase
std::string hiScoreName; // Nombre del jugador con la máxima puntuación
color_t color; // Color del marcador
SDL_Rect rect; // Posición y dimensiones del marcador
panel_t panel[SCOREBOARD_MAX_PANELS]; // Lista con todos los paneles del marcador
Uint32 ticks; // Variable donde almacenar el valor de SDL_GetTiks()
int counter; // Contador
int stage; // Número de fase actual
std::string name[SCOREBOARD_MAX_PANELS]; // Nom de cada jugador
std::string recordName[SCOREBOARD_MAX_PANELS]; // Nombre introducido para la tabla de records
int selectorPos[SCOREBOARD_MAX_PANELS]; // Posición del selector de letra para introducir el nombre
int score[SCOREBOARD_MAX_PANELS]; // Puntuación de los jugadores
float mult[SCOREBOARD_MAX_PANELS]; // Multiplicador de los jugadores
int continueCounter[SCOREBOARD_MAX_PANELS]; // Tiempo para continuar de los jugadores
int hiScore; // Máxima puntuación
float power; // Poder actual de la fase
std::string hiScoreName; // Nombre del jugador con la máxima puntuación
color_t color; // Color del marcador
SDL_Rect rect; // Posición y dimensiones del marcador
panel_t panel[SCOREBOARD_MAX_PANELS]; // Lista con todos los paneles del marcador
Uint32 ticks; // Variable donde almacenar el valor de SDL_GetTiks()
int counter; // Contador
// Puntos predefinidos para colocar elementos en los paneles
SDL_Point slot4_1, slot4_2, slot4_3, slot4_4;
SDL_Point enterNamePos;
// Recalcula las anclas de los elementos
void recalculateAnchors();
@@ -109,6 +112,12 @@ public:
// Establece el valor de la variable
void setName(int panel, std::string name);
// Establece el valor de la variable
void setRecordName(int panel, std::string recordName);
// Establece el valor de la variable
void setSelectorPos(int panel, int pos);
// Establece el valor de la variable
void setScore(int panel, int score);