fix: la variable score no s'inicialitzava
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user