Compare commits
2 Commits
59da8fd4c6
...
448da70ba8
| Author | SHA1 | Date | |
|---|---|---|---|
| 448da70ba8 | |||
| 24b4eaa972 |
@@ -63,7 +63,7 @@ Game::Game(int playerID, int currentStage, Screen *screen, Asset *asset, Lang *l
|
||||
|
||||
Game::~Game()
|
||||
{
|
||||
//saveScoreFile();
|
||||
// saveScoreFile();
|
||||
#ifdef RECORDING
|
||||
saveDemoFile();
|
||||
#endif
|
||||
@@ -916,6 +916,7 @@ void Game::updateHiScore()
|
||||
{
|
||||
// Si la puntuación actual es mayor que la máxima puntuación
|
||||
for (auto player : players)
|
||||
{
|
||||
if (player->getScore() > hiScore.score)
|
||||
{
|
||||
// Actualiza la máxima puntuación
|
||||
@@ -928,6 +929,7 @@ void Game::updateHiScore()
|
||||
JA_PlaySound(hiScoreSound);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Actualiza las variables del jugador
|
||||
@@ -2815,7 +2817,7 @@ void Game::reloadTextures()
|
||||
void Game::setHiScore()
|
||||
{
|
||||
// Carga el fichero de puntos
|
||||
//loadScoreFile();
|
||||
// loadScoreFile();
|
||||
|
||||
hiScore.score = options->game.hiScoreTable[0].score;
|
||||
hiScore.name = options->game.hiScoreTable[0].name;
|
||||
|
||||
@@ -21,6 +21,7 @@ Player::Player(float x, int y, std::vector<Texture *> texture, std::vector<std::
|
||||
statusPlaying = PLAYER_STATUS_WAITING;
|
||||
scoreBoardPanel = 0;
|
||||
name = "";
|
||||
init();
|
||||
}
|
||||
|
||||
// Destructor
|
||||
@@ -36,7 +37,6 @@ void Player::init()
|
||||
// Inicializa variables de estado
|
||||
posX = defaultPosX;
|
||||
posY = defaultPosY;
|
||||
statusPlaying = PLAYER_STATUS_PLAYING;
|
||||
statusWalking = PLAYER_STATUS_WALKING_STOP;
|
||||
statusFiring = PLAYER_STATUS_FIRING_NO;
|
||||
invulnerable = true;
|
||||
@@ -282,13 +282,13 @@ int Player::getScore()
|
||||
}
|
||||
|
||||
// Asigna un valor a la puntuación del jugador
|
||||
void Player::setScore(Uint32 score)
|
||||
void Player::setScore(int score)
|
||||
{
|
||||
this->score = score;
|
||||
}
|
||||
|
||||
// Incrementa la puntuación del jugador
|
||||
void Player::addScore(Uint32 score)
|
||||
void Player::addScore(int score)
|
||||
{
|
||||
if (isPlaying())
|
||||
{
|
||||
@@ -322,6 +322,7 @@ void Player::setStatusPlaying(int value)
|
||||
switch (statusPlaying)
|
||||
{
|
||||
case PLAYER_STATUS_PLAYING:
|
||||
statusPlaying = PLAYER_STATUS_PLAYING;
|
||||
init();
|
||||
break;
|
||||
|
||||
|
||||
@@ -34,28 +34,21 @@ private:
|
||||
AnimatedSprite *powerSprite; // Sprite para dibujar el aura del jugador con el poder a tope
|
||||
|
||||
// Variables
|
||||
float posX; // Posicion en el eje X
|
||||
int posY; // Posicion en el eje Y
|
||||
|
||||
float defaultPosX; // Posición inicial para el jugador
|
||||
int defaultPosY; // Posición inicial para el jugador
|
||||
|
||||
int width; // Anchura
|
||||
int height; // Altura
|
||||
|
||||
float velX; // Cantidad de pixeles a desplazarse en el eje X
|
||||
int velY; // Cantidad de pixeles a desplazarse en el eje Y
|
||||
|
||||
float baseSpeed; // Velocidad base del jugador
|
||||
int cooldown; // Contador durante el cual no puede disparar
|
||||
|
||||
int score; // Puntos del jugador
|
||||
float scoreMultiplier; // Multiplicador de puntos
|
||||
|
||||
int statusWalking; // Estado del jugador al moverse
|
||||
int statusFiring; // Estado del jugador al disparar
|
||||
int statusPlaying; // Estado del jugador en el juego
|
||||
|
||||
float posX; // Posicion en el eje X
|
||||
int posY; // Posicion en el eje Y
|
||||
float defaultPosX; // Posición inicial para el jugador
|
||||
int defaultPosY; // Posición inicial para el jugador
|
||||
int width; // Anchura
|
||||
int height; // Altura
|
||||
float velX; // Cantidad de pixeles a desplazarse en el eje X
|
||||
int velY; // Cantidad de pixeles a desplazarse en el eje Y
|
||||
float baseSpeed; // Velocidad base del jugador
|
||||
int cooldown; // Contador durante el cual no puede disparar
|
||||
int score; // Puntos del jugador
|
||||
float scoreMultiplier; // Multiplicador de puntos
|
||||
int statusWalking; // Estado del jugador al moverse
|
||||
int statusFiring; // Estado del jugador al disparar
|
||||
int statusPlaying; // Estado del jugador en el juego
|
||||
bool invulnerable; // Indica si el jugador es invulnerable
|
||||
int invulnerableCounter; // Contador para la invulnerabilidad
|
||||
bool extraHit; // Indica si el jugador tiene un toque extra
|
||||
@@ -138,10 +131,10 @@ public:
|
||||
int getScore();
|
||||
|
||||
// Asigna un valor a la puntuación del jugador
|
||||
void setScore(Uint32 score);
|
||||
void setScore(int score);
|
||||
|
||||
// Incrementa la puntuación del jugador
|
||||
void addScore(Uint32 score);
|
||||
void addScore(int score);
|
||||
|
||||
// Indica si el jugador está jugando
|
||||
bool isPlaying();
|
||||
|
||||
Reference in New Issue
Block a user