acabats els nous estats dels jugadors
This commit is contained in:
@@ -20,6 +20,8 @@ Player::Player(float x, int y, std::vector<Texture *> texture, std::vector<std::
|
||||
// Inicializa variables
|
||||
// enabled = false;
|
||||
statusPlaying = PLAYER_STATUS_WAITING;
|
||||
scoreBoardPanel = 0;
|
||||
name = "";
|
||||
init();
|
||||
}
|
||||
|
||||
@@ -542,16 +544,7 @@ void Player::updateContinueCounter()
|
||||
|
||||
if (SDL_GetTicks() - continueTicks > ticksSpeed)
|
||||
{
|
||||
// Actualiza el contador de ticks
|
||||
continueTicks = SDL_GetTicks();
|
||||
|
||||
// Decrementa el contador
|
||||
continueCounter--;
|
||||
|
||||
if (continueCounter < 0)
|
||||
{
|
||||
setStatusPlaying(PLAYER_STATUS_WAITING);
|
||||
}
|
||||
decContinueCounter();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -566,4 +559,28 @@ void Player::setScoreBoardPanel(int panel)
|
||||
int Player::getScoreBoardPanel()
|
||||
{
|
||||
return scoreBoardPanel;
|
||||
}
|
||||
|
||||
// Decrementa el contador de continuar
|
||||
void Player::decContinueCounter()
|
||||
{
|
||||
continueTicks = SDL_GetTicks();
|
||||
continueCounter--;
|
||||
|
||||
if (continueCounter < 0)
|
||||
{
|
||||
setStatusPlaying(PLAYER_STATUS_WAITING);
|
||||
}
|
||||
}
|
||||
|
||||
// Establece el nombre del jugador
|
||||
void Player::setName(std::string name)
|
||||
{
|
||||
this->name = name;
|
||||
}
|
||||
|
||||
// Obtiene el nombre del jugador
|
||||
std::string Player::getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
Reference in New Issue
Block a user