Quitadas todas las variables globales y transformadas en punteros

This commit is contained in:
2022-10-20 18:24:12 +02:00
parent 596bf2c4a5
commit b4e76a4c7d
25 changed files with 848 additions and 781 deletions

View File

@@ -18,7 +18,7 @@ class GameDirector
{
public:
// Constructor
GameDirector();
GameDirector(SDL_Renderer *gRenderer);
// Destructor
~GameDirector();
@@ -129,6 +129,9 @@ public:
void runPausedGame();
private:
// El renderizador de la ventana
SDL_Renderer *gRenderer = NULL;
// Objetos con la música del juego
Mix_Music *gTitleMusic = NULL;
Mix_Music *gPlayingMusic = NULL;
@@ -140,21 +143,28 @@ private:
// Manejador para el mando 1
SDL_Joystick *gGameController = NULL;
// Texturas
LTexture *gGameBackgroundTexture;
LTexture *gTitleBackgroundTexture;
LTexture *gWhiteFontTexture;
LTexture *gBlackFontTexture;
LTexture *gMiscTexture;
// Manejador de eventos
SDL_Event eventHandler;
// El jugador
Player player;
Player *player;
// Vector con los objetos globo
Balloon balloon[50];
Balloon *balloon[50];
#ifdef TEST
Balloon balloonTest;
Bullet bulletTest;
#endif
// Vector con los objetos bala
Bullet bullet[50];
Bullet *bullet[50];
// Fondo del juego
Background gameBackground;
@@ -169,10 +179,10 @@ private:
Text blackText;
// Menu de la pantalla de título
Menu menuTitle;
Menu *menuTitle;
// Menú de la pantalla de pausa
Menu menuPause;
Menu *menuPause;
// Indicador para el bucle principal
Uint8 mGameStatus;