Eliminada la classe Lang

This commit is contained in:
2024-09-26 18:08:59 +02:00
parent 6ad1bca29f
commit 69027f96e6
16 changed files with 94 additions and 158 deletions

View File

@@ -3,12 +3,11 @@
#define GAME_OVER_COUNTER 350
// Constructor
Game::Game(int playerID, int currentStage, bool demo, Screen *screen, Asset *asset, Input *input, Lang *lang, options_t *options, param_t *param, section_t *section, JA_Music_t *music)
Game::Game(int playerID, int currentStage, bool demo, Screen *screen, Asset *asset, Input *input, options_t *options, param_t *param, section_t *section, JA_Music_t *music)
{
// Copia los punteros
this->screen = screen;
this->asset = asset;
this->lang = lang;
this->input = input;
this->param = param;
this->options = options;
@@ -25,7 +24,7 @@ Game::Game(int playerID, int currentStage, bool demo, Screen *screen, Asset *ass
// Crea los objetos
fade = new Fade(renderer, param);
eventHandler = new SDL_Event();
scoreboard = new Scoreboard(renderer, asset, lang, options);
scoreboard = new Scoreboard(renderer, asset, options);
background = new Background(renderer, asset, param);
explosions = new Explosions();
enemyFormations = new EnemyFormations(param);
@@ -110,14 +109,14 @@ void Game::init(int playerID)
// Crea los dos jugadores
Player *player1 = new Player(1, (param->game.playArea.firstQuarterX * ((0 * 2) + 1)) - 11, param->game.playArea.rect.h - 30, &param->game.playArea.rect, playerTextures[0], playerAnimations);
player1->setScoreBoardPanel(SCOREBOARD_LEFT_PANEL);
player1->setName(lang->getText(53));
player1->setName(lang::getText(53));
const int controller1 = getController(player1->getId());
player1->setController(controller1);
players.push_back(player1);
Player *player2 = new Player(2, (param->game.playArea.firstQuarterX * ((1 * 2) + 1)) - 11, param->game.playArea.rect.h - 30, &param->game.playArea.rect, playerTextures[1], playerAnimations);
player2->setScoreBoardPanel(SCOREBOARD_RIGHT_PANEL);
player2->setName(lang->getText(54));
player2->setName(lang::getText(54));
const int controller2 = getController(player2->getId());
player2->setController(controller2);
players.push_back(player2);
@@ -2284,7 +2283,7 @@ void Game::renderMessages()
// GetReady
if ((counter < STAGE_COUNTER) && (!demo.enabled))
{
textNokiaBig2->write((int)getReadyBitmapPath[counter], param->game.playArea.centerY - 8, lang->getText(75), -2);
textNokiaBig2->write((int)getReadyBitmapPath[counter], param->game.playArea.centerY - 8, lang::getText(75), -2);
}
// Time Stopped
@@ -2292,7 +2291,7 @@ void Game::renderMessages()
{
if ((timeStoppedCounter > 100) || (timeStoppedCounter % 10 > 4))
{
textNokia2->writeDX(TXT_CENTER, param->game.playArea.centerX, param->game.playArea.firstQuarterY, lang->getText(36) + std::to_string(timeStoppedCounter / 10), -1, noColor, 1, shdwTxtColor);
textNokia2->writeDX(TXT_CENTER, param->game.playArea.centerX, param->game.playArea.firstQuarterY, lang::getText(36) + std::to_string(timeStoppedCounter / 10), -1, noColor, 1, shdwTxtColor);
}
if (timeStoppedCounter > 100)
@@ -2321,11 +2320,11 @@ void Game::renderMessages()
if (stageNum == 10)
{ // Ultima fase
text = lang->getText(79);
text = lang::getText(79);
}
else
{ // X fases restantes
text = std::to_string(11 - stageNum) + lang->getText(38);
text = std::to_string(11 - stageNum) + lang::getText(38);
}
if (!gameCompleted)
@@ -2334,9 +2333,9 @@ void Game::renderMessages()
}
else
{ // Escribe el texto de juego completado
text = lang->getText(50);
text = lang::getText(50);
textNokiaBig2->writeDX(TXT_CENTER, param->game.playArea.centerX, stageBitmapPath[stageBitmapCounter], text, -2, noColor, 1, shdwTxtColor);
textNokia2->writeDX(TXT_CENTER, param->game.playArea.centerX, stageBitmapPath[stageBitmapCounter] + textNokiaBig2->getCharacterSize() + 2, lang->getText(76), -1, noColor, 1, shdwTxtColor);
textNokia2->writeDX(TXT_CENTER, param->game.playArea.centerX, stageBitmapPath[stageBitmapCounter] + textNokiaBig2->getCharacterSize() + 2, lang::getText(76), -1, noColor, 1, shdwTxtColor);
}
}
}
@@ -2462,7 +2461,7 @@ void Game::initPaths()
}
// Letrero de GetReady
const int size = textNokiaBig2->lenght(lang->getText(75), -2);
const int size = textNokiaBig2->lenght(lang::getText(75), -2);
const float start1 = PLAY_AREA_LEFT - size;
const float finish1 = param->game.playArea.centerX - (size / 2);