lang class
This commit is contained in:
@@ -5,12 +5,12 @@
|
||||
#endif
|
||||
|
||||
// Constructor
|
||||
Game::Game(int numPlayers, SDL_Renderer *renderer, std::string *filelist, std::string *textStrings, Input *input1, Input *input2, bool demo)
|
||||
Game::Game(int numPlayers, SDL_Renderer *renderer, std::string *filelist, Lang *lang, Input *input1, Input *input2, bool demo)
|
||||
{
|
||||
// Copia los punteros
|
||||
mRenderer = renderer;
|
||||
mFileList = filelist;
|
||||
mTextStrings = textStrings;
|
||||
mLang = lang;
|
||||
mInput[0] = input1;
|
||||
mInput[1] = input2;
|
||||
mDemo.enabled = demo;
|
||||
@@ -361,8 +361,8 @@ void Game::init()
|
||||
|
||||
// Inicializa el objeto con el menu de pausa
|
||||
mMenuPause->init("PAUSE", 0, 12 * BLOCK, MENU_BACKGROUND_SOLID);
|
||||
mMenuPause->addItem(mTextStrings[46]);
|
||||
mMenuPause->addItem(mTextStrings[47]);
|
||||
mMenuPause->addItem(mLang->getText(46));
|
||||
mMenuPause->addItem(mLang->getText(47));
|
||||
mMenuPause->setDefaultActionWhenCancel(0);
|
||||
mMenuPause->setBackgroundColor(0x29, 0x39, 0x41, 240);
|
||||
mMenuPause->setSelectorColor(0xFF, 0x7A, 0x00, 255);
|
||||
@@ -372,8 +372,8 @@ void Game::init()
|
||||
|
||||
// Inicializa el objeto con el menu de la pantalla de game over
|
||||
mMenuGameOver->init("GAME OVER", 0, PLAY_AREA_CENTER_Y + BLOCK * 4, MENU_BACKGROUND_TRANSPARENT);
|
||||
mMenuGameOver->addItem(mTextStrings[48]);
|
||||
mMenuGameOver->addItem(mTextStrings[49]);
|
||||
mMenuGameOver->addItem(mLang->getText(48));
|
||||
mMenuGameOver->addItem(mLang->getText(49));
|
||||
mMenuGameOver->setDefaultActionWhenCancel(1);
|
||||
mMenuGameOver->setBackgroundColor(0, 0, 0, 255);
|
||||
mMenuGameOver->setSelectorColor(0x54, 0x6e, 0x7a, 255);
|
||||
@@ -1568,16 +1568,16 @@ void Game::renderScoreBoard()
|
||||
mSpriteScoreBoard->render();
|
||||
/*
|
||||
// SCORE
|
||||
mText->writeCentered(PLAY_AREA_CENTER_FIRST_QUARTER_X, SCORE_WORD_Y - 6, mTextStrings[39], 0);
|
||||
mText->writeCentered(PLAY_AREA_CENTER_FIRST_QUARTER_X, SCORE_WORD_Y - 6, mLang->getText(39), 0);
|
||||
mText->writeCentered(PLAY_AREA_CENTER_FIRST_QUARTER_X, SCORE_NUMBER_Y - 6, updateScoreText(mPlayer[0]->getScore()), 0);
|
||||
|
||||
// HI-SCORE
|
||||
mText->writeCentered(PLAY_AREA_CENTER_THIRD_QUARTER_X, HISCORE_WORD_Y - 6, mTextStrings[40], 0);
|
||||
mText->writeCentered(PLAY_AREA_CENTER_THIRD_QUARTER_X, HISCORE_WORD_Y - 6, mLang->getText(40), 0);
|
||||
mText->writeCentered(PLAY_AREA_CENTER_THIRD_QUARTER_X, HISCORE_NUMBER_Y - 6, updateScoreText(mHiScore), 0);
|
||||
|
||||
// MULT
|
||||
color.g = 255;
|
||||
mText->writeColored(MULTIPLIER_WORD_X, MULTIPLIER_WORD_Y - 6, mTextStrings[41], color);
|
||||
mText->writeColored(MULTIPLIER_WORD_X, MULTIPLIER_WORD_Y - 6, mLang->getText(41), color);
|
||||
|
||||
color.g = 192;
|
||||
mTextX2->writeShadowed(PLAY_AREA_CENTER_X - 16, SCORE_WORD_Y + 5, std::to_string(mPlayer[0]->getScoreMultiplier()).substr(0, 1), color, 1);
|
||||
@@ -1585,7 +1585,7 @@ void Game::renderScoreBoard()
|
||||
mText->writeShadowed(PLAY_AREA_CENTER_X + 4, SCORE_WORD_Y + 12, std::to_string(mPlayer[0]->getScoreMultiplier()).substr(2, 1), color);
|
||||
|
||||
// STAGE
|
||||
mText->writeCentered(PLAY_AREA_CENTER_FIRST_QUARTER_X, SCORE_NUMBER_Y + 4, mTextStrings[42] + std::to_string(mStage[mCurrentStage].number), 0);
|
||||
mText->writeCentered(PLAY_AREA_CENTER_FIRST_QUARTER_X, SCORE_NUMBER_Y + 4, mLang->getText(42) + std::to_string(mStage[mCurrentStage].number), 0);
|
||||
|
||||
// POWER
|
||||
mSpritePowerMeter->setSpriteClip(256, 184, 40, 8);
|
||||
@@ -1599,33 +1599,33 @@ void Game::renderScoreBoard()
|
||||
const int offset3 = offset2 + 8;
|
||||
//const int offset4 = offset3 + 8;
|
||||
// PLAYER1 - SCORE
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_LEFT + 30, offset1, mTextStrings[53]);
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_LEFT + 30, offset1, mLang->getText(53));
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_LEFT + 30, offset2, updateScoreText(mPlayer[0]->getScore()));
|
||||
|
||||
// PLAYER1 - MULT
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_LEFT + 30, offset3, mTextStrings[55] + std::to_string(mPlayer[0]->getScoreMultiplier()).substr(0, 3));
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_LEFT + 30, offset3, mLang->getText(55) + std::to_string(mPlayer[0]->getScoreMultiplier()).substr(0, 3));
|
||||
|
||||
if (mNumPlayers == 2)
|
||||
{
|
||||
// PLAYER2 - SCORE
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - 30, offset1, mTextStrings[54]);
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - 30, offset1, mLang->getText(54));
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - 30, offset2, updateScoreText(mPlayer[1]->getScore()));
|
||||
|
||||
// PLAYER2 - MULT
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - 30, offset3, mTextStrings[55] + std::to_string(mPlayer[1]->getScoreMultiplier()).substr(0, 3));
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - 30, offset3, mLang->getText(55) + std::to_string(mPlayer[1]->getScoreMultiplier()).substr(0, 3));
|
||||
}
|
||||
else
|
||||
{
|
||||
// PLAYER2 - SCORE
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - 30, offset1, mTextStrings[54]);
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - 30, offset1, mLang->getText(54));
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - 30, offset2, "0000000");
|
||||
|
||||
// PLAYER2 - MULT
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - 30, offset3, mTextStrings[55] + "1.0");
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_RIGHT - 30, offset3, mLang->getText(55) + "1.0");
|
||||
}
|
||||
|
||||
// STAGE
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset1 - 1, mTextStrings[57] + std::to_string(mStage[mCurrentStage].number));
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset1 - 1, mLang->getText(57) + std::to_string(mStage[mCurrentStage].number));
|
||||
|
||||
// POWER
|
||||
mSpritePowerMeter->setSpriteClip(256, 184, 40, 8);
|
||||
@@ -1635,7 +1635,7 @@ void Game::renderScoreBoard()
|
||||
mSpritePowerMeter->render();
|
||||
|
||||
// HI-SCORE
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset3 + 1, mTextStrings[56] + updateScoreText(mHiScore));
|
||||
mTextScoreBoard->writeCentered(PLAY_AREA_CENTER_X, offset3 + 1, mLang->getText(56) + updateScoreText(mHiScore));
|
||||
}
|
||||
|
||||
// Actualiza las variables del jugador
|
||||
@@ -2907,7 +2907,7 @@ void Game::renderMessages()
|
||||
{
|
||||
if ((mTimeStoppedCounter > 100) || (mTimeStoppedCounter % 10 > 4))
|
||||
//mText->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y, "Time Stopped: " + std::to_string(mTimeStoppedCounter / 10));
|
||||
mText->writeDX(TXT_CENTER | TXT_SHADOW, PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y, mTextStrings[36] + std::to_string(mTimeStoppedCounter / 10), 1, noColor, 1, shdwTxtColor);
|
||||
mText->writeDX(TXT_CENTER | TXT_SHADOW, PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y, mLang->getText(36) + std::to_string(mTimeStoppedCounter / 10), 1, noColor, 1, shdwTxtColor);
|
||||
|
||||
if (mTimeStoppedCounter > 100)
|
||||
{
|
||||
@@ -2924,12 +2924,12 @@ void Game::renderMessages()
|
||||
// D E M O
|
||||
if (mDemo.enabled)
|
||||
if (mDemo.counter % 30 > 14)
|
||||
mTextBig->writeDX(TXT_CENTER | TXT_SHADOW, PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y, mTextStrings[37], 0, noColor, 2, shdwTxtColor);
|
||||
mTextBig->writeDX(TXT_CENTER | TXT_SHADOW, PLAY_AREA_CENTER_X, PLAY_AREA_FIRST_QUARTER_Y, mLang->getText(37), 0, noColor, 2, shdwTxtColor);
|
||||
|
||||
// STAGE NUMBER
|
||||
std::string text = mTextStrings[38] + std::to_string(mStage[mCurrentStage].number);
|
||||
std::string text = mLang->getText(38) + std::to_string(mStage[mCurrentStage].number);
|
||||
if (mGameCompleted) // Texto de juego completado
|
||||
text = mTextStrings[50];
|
||||
text = mLang->getText(50);
|
||||
|
||||
if (mStageBitmapCounter < STAGE_COUNTER)
|
||||
mTextBig->writeDX(TXT_CENTER | TXT_SHADOW, PLAY_AREA_CENTER_X, mStageBitmapPath[mStageBitmapCounter], text, 1, noColor, 2, shdwTxtColor);
|
||||
@@ -3258,9 +3258,9 @@ void Game::runGameOverScreen()
|
||||
SDL_RenderClear(mRenderer);
|
||||
|
||||
// Dibuja los objetos
|
||||
mTextBig->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y - (BLOCK * 4), mTextStrings[43]);
|
||||
mText->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y - (BLOCK * 1), mTextStrings[44] + std::to_string(mPlayer[0]->getScore()));
|
||||
mText->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y + BLOCK * 2, mTextStrings[45]);
|
||||
mTextBig->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y - (BLOCK * 4), mLang->getText(43));
|
||||
mText->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y - (BLOCK * 1), mLang->getText(44) + std::to_string(mPlayer[0]->getScore()));
|
||||
mText->writeCentered(PLAY_AREA_CENTER_X, PLAY_AREA_CENTER_Y + BLOCK * 2, mLang->getText(45));
|
||||
mMenuGameOver->render();
|
||||
mFade->render();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user