Solved 1P death music. Some tweaks to bg.png
This commit is contained in:
@@ -1737,10 +1737,10 @@ void Game::updateStage()
|
||||
void Game::updateDeath()
|
||||
{
|
||||
// Comprueba si todos los jugadores estan muertos
|
||||
bool allPlayersAreDead = true;
|
||||
bool allAreDead = true;
|
||||
for (int i = 0; i < mNumPlayers; i++)
|
||||
{
|
||||
allPlayersAreDead &= (!mPlayer[i]->isAlive());
|
||||
allAreDead &= (!mPlayer[i]->isAlive());
|
||||
|
||||
if (!mPlayer[i]->isAlive())
|
||||
{
|
||||
@@ -1776,9 +1776,9 @@ void Game::updateDeath()
|
||||
}
|
||||
}
|
||||
|
||||
if (allPlayersAreDead)
|
||||
if (allAreDead)
|
||||
{
|
||||
JA_StopMusic();
|
||||
//JA_StopMusic();
|
||||
|
||||
if (mDeathCounter > 0)
|
||||
{
|
||||
@@ -2530,14 +2530,18 @@ void Game::killPlayer(int index)
|
||||
}
|
||||
else
|
||||
{
|
||||
JA_PauseMusic();
|
||||
stopAllBalloons(10);
|
||||
//JA_StopMusic();
|
||||
JA_PlaySound(mSoundPlayerCollision);
|
||||
shakeScreen();
|
||||
SDL_Delay(500);
|
||||
JA_PlaySound(mSoundCoffeeOut);
|
||||
throwPlayer(mPlayer[index]->getPosX(), mPlayer[index]->getPosY(), index);
|
||||
mPlayer[index]->setAlive(false);
|
||||
if (allPlayersAreDead())
|
||||
JA_StopMusic();
|
||||
else
|
||||
JA_ResumeMusic();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3478,4 +3482,14 @@ void Game::updateHelper()
|
||||
mHelper.needCoffee = false;
|
||||
mHelper.needCoffeeMachine = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Comprueba si todos los jugadores han muerto
|
||||
bool Game::allPlayersAreDead()
|
||||
{
|
||||
bool success = true;
|
||||
for (int i = 0; i < mNumPlayers; i++)
|
||||
success &= (!mPlayer[i]->isAlive());
|
||||
|
||||
return success;
|
||||
}
|
||||
@@ -191,7 +191,7 @@ private:
|
||||
Uint8 mDifficulty; // Dificultad del juego
|
||||
float mDifficultyScoreMultiplier; // Multiplicador de puntos en función de la dificultad
|
||||
struct options_t *mOptions; // Variable con todas las variables de las opciones del programa
|
||||
Uint8 mOnePlayerControl; // Variable para almacenar el valor de las opciones
|
||||
Uint8 mOnePlayerControl; // Variable para almacenar el valor de las opciones
|
||||
|
||||
struct demo_t
|
||||
{
|
||||
@@ -212,13 +212,6 @@ private:
|
||||
};
|
||||
debug_t mDebug;
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Game(int numPlayers, SDL_Renderer *renderer, std::string *filelist, Lang *lang, Input *input, bool demo, options_t *options);
|
||||
|
||||
// Destructor
|
||||
~Game();
|
||||
|
||||
// Inicializa el vector con los valores del seno
|
||||
void initSin();
|
||||
|
||||
@@ -255,9 +248,6 @@ public:
|
||||
// Aumenta el poder de la fase
|
||||
void increaseStageCurrentPower(Uint8 power);
|
||||
|
||||
// Establece el valor de la variable
|
||||
//void setScore(Uint32 score);
|
||||
|
||||
// Establece el valor de la variable
|
||||
void setHiScore(Uint32 score);
|
||||
|
||||
@@ -477,9 +467,6 @@ public:
|
||||
// Agita la pantalla
|
||||
void shakeScreen();
|
||||
|
||||
// Bucle para el juego
|
||||
section_t run();
|
||||
|
||||
// Bucle para el menu de pausa del juego
|
||||
void runPausedGame();
|
||||
|
||||
@@ -503,6 +490,19 @@ public:
|
||||
|
||||
// Actualiza las variables de ayuda
|
||||
void updateHelper();
|
||||
|
||||
// Comprueba si todos los jugadores han muerto
|
||||
bool allPlayersAreDead();
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
Game(int numPlayers, SDL_Renderer *renderer, std::string *filelist, Lang *lang, Input *input, bool demo, options_t *options);
|
||||
|
||||
// Destructor
|
||||
~Game();
|
||||
|
||||
// Bucle para el juego
|
||||
section_t run();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -640,6 +640,7 @@ void Player::setInvulnerableCounter(Uint16 value)
|
||||
void Player::updateInvulnerableCounter()
|
||||
{
|
||||
if (mInvulnerable)
|
||||
{
|
||||
if (mInvulnerableCounter > 0)
|
||||
{
|
||||
mInvulnerableCounter--;
|
||||
@@ -649,6 +650,7 @@ void Player::updateInvulnerableCounter()
|
||||
mInvulnerable = false;
|
||||
mInvulnerableCounter = PLAYER_INVULNERABLE_COUNTER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Actualiza el valor de la variable
|
||||
|
||||
@@ -221,8 +221,8 @@ void Title::init(bool demo, Uint8 subsection)
|
||||
// Crea el mosaico de fondo del titulo
|
||||
createTiledBackground();
|
||||
|
||||
mBackgroundWindow.x = 0;
|
||||
mBackgroundWindow.y = 0;
|
||||
mBackgroundWindow.x = 128;
|
||||
mBackgroundWindow.y = 96;
|
||||
mBackgroundWindow.w = SCREEN_WIDTH;
|
||||
mBackgroundWindow.h = SCREEN_HEIGHT;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user