fix: fallava al parar la musica al morir el jugador en el mode de demostració
This commit is contained in:
@@ -218,7 +218,7 @@ void Game::init(int playerID)
|
|||||||
// Añade 0, 1 o 2 cafes al jugador
|
// Añade 0, 1 o 2 cafes al jugador
|
||||||
for (int i = 0; i < rand() % 3; ++i)
|
for (int i = 0; i < rand() % 3; ++i)
|
||||||
{
|
{
|
||||||
//player->giveExtraHit();
|
player->giveExtraHit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Empieza sin inmunidad
|
// Empieza sin inmunidad
|
||||||
@@ -1812,15 +1812,18 @@ void Game::killPlayer(Player *player)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Si no tiene cafes, muere
|
{ // Si no tiene cafes, muere
|
||||||
JA_PauseMusic();
|
if (!demo.enabled)
|
||||||
|
{
|
||||||
|
JA_PauseMusic();
|
||||||
|
}
|
||||||
stopAllBalloons(10);
|
stopAllBalloons(10);
|
||||||
JA_PlaySound(playerCollisionSound);
|
JA_PlaySound(playerCollisionSound);
|
||||||
screen->shake();
|
screen->shake();
|
||||||
JA_PlaySound(coffeeOutSound);
|
JA_PlaySound(coffeeOutSound);
|
||||||
player->setAlive(false);
|
player->setAlive(false);
|
||||||
allPlayersAreDead() ? JA_StopMusic() : JA_ResumeMusic();
|
|
||||||
if (!demo.enabled)
|
if (!demo.enabled)
|
||||||
{
|
{ // En el modo DEMO ni se para la musica ni se añade la puntuación a la tabla
|
||||||
|
allPlayersAreDead() ? JA_StopMusic() : JA_ResumeMusic();
|
||||||
addScoreToScoreBoard("Sergio", player->getScore());
|
addScoreToScoreBoard("Sergio", player->getScore());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user