Modificado el texto al cambiar de pantalla. Quitado texto no usado

This commit is contained in:
2022-09-25 19:38:03 +02:00
parent 1fa5c75466
commit 778b07cce1
4 changed files with 79 additions and 52 deletions

View File

@@ -1541,7 +1541,7 @@ void Game::updateHiScore()
// Transforma un valor numérico en una cadena de 6 cifras
std::string Game::updateScoreText(Uint32 num)
{
//return (std::to_string(num));
// return (std::to_string(num));
if ((num >= 0) && (num <= 9))
{
@@ -2061,7 +2061,7 @@ void Game::popAllBalloons()
void Game::destroyAllBalloons()
{
for (int i = 0; i < MAX_BALLOONS; i++)
//if ((mBalloon[i]->isEnabled()) && (!mBalloon[i]->isPopping()) && (!mBalloon[i]->isBeingCreated()))
// if ((mBalloon[i]->isEnabled()) && (!mBalloon[i]->isPopping()) && (!mBalloon[i]->isBeingCreated()))
if ((mBalloon[i]->isEnabled()) && (!mBalloon[i]->isPopping()))
destroyBalloon(i);
@@ -2927,35 +2927,56 @@ void Game::renderMessages()
if (mTimeStopped)
{
if ((mTimeStoppedCounter > 100) || (mTimeStoppedCounter % 10 > 4))
{
mTextNokia2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y, mLang->getText(36) + std::to_string(mTimeStoppedCounter / 10), -1, noColor, 1, shdwTxtColor);
}
if (mTimeStoppedCounter > 100)
{
if (mTimeStoppedCounter % 30 == 0)
{
JA_PlaySound(mSoundClock, false);
}
}
else
{
if (mTimeStoppedCounter % 15 == 0)
{
JA_PlaySound(mSoundClock, false);
}
}
}
// D E M O
if (mDemo.enabled)
{
if (mDemo.counter % 30 > 14)
{
mTextNokiaBig2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y, mLang->getText(37), 0, noColor, 2, shdwTxtColor);
}
}
// STAGE NUMBER
if (mStageBitmapCounter < STAGE_COUNTER)
{
std::string text = mLang->getText(38) + std::to_string(mStage[mCurrentStage].number);
const int stage = mStage[mCurrentStage].number;
std::string text;
if (stage == 10)
{ // Ultima fase
text = mLang->getText(79);
}
else
{ // X fases restantes
text = std::to_string(11 - mStage[mCurrentStage].number) + mLang->getText(38);
}
if (!mGameCompleted)
{
{ // Escribe el numero de fases restantes
mTextNokiaBig2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, mStageBitmapPath[mStageBitmapCounter], text, -2, noColor, 2, shdwTxtColor);
}
else
{ // Texto de juego completado
{ // Escribe el texto de juego completado
text = mLang->getText(50);
mTextNokiaBig2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, mStageBitmapPath[mStageBitmapCounter], text, -2, noColor, 1, shdwTxtColor);
mTextNokia2->writeDX(TXT_CENTER, PLAY_AREA_CENTER_X, mStageBitmapPath[mStageBitmapCounter] + mTextNokiaBig2->getCharacterWidth() + 2, mLang->getText(76), -1, noColor, 1, shdwTxtColor);
@@ -2990,8 +3011,8 @@ void Game::shakeScreen()
for (int n = 0; n < 8; n++)
{
// Limpia la pantalla
//SDL_SetRenderDrawColor(mRenderer, 0x00, 0x00, 0x00, 0xFF);
//SDL_RenderClear(mRenderer);
// SDL_SetRenderDrawColor(mRenderer, 0x00, 0x00, 0x00, 0xFF);
// SDL_RenderClear(mRenderer);
// Prepara para empezar a dibujar en la textura de juego
mScreen->start();
@@ -3023,8 +3044,8 @@ void Game::shakeScreen()
renderScoreBoard();
// Actualiza la pantalla
//SDL_RenderPresent(mRenderer);
// SDL_RenderPresent(mRenderer);
// Vuelca el contenido del renderizador en pantalla
mScreen->blit();
SDL_Delay(50);