working on 2players

This commit is contained in:
2021-08-22 19:50:55 +02:00
parent 2fd4334259
commit 943fb7bf27
5 changed files with 350 additions and 272 deletions

View File

@@ -82,26 +82,31 @@ private:
SDL_Renderer *mRenderer; // El renderizador de la ventana
std::string *mFileList; // Lista de ficheros con los recursos
std::string *mTextStrings; // Vector con los textos del juego
Input *mInput; // Manejador de entrada
Input *mInput[2]; // Manejador de entrada
Player *mPlayer; // El jugador
int mNumPlayers; // Numero de jugadores
Player *mPlayer[2]; // Vector con los jugadores jugador
Balloon *mBalloon[MAX_BALLOONS]; // Vector con los objetos globo
Bullet *mBullet[MAX_BULLETS]; // Vector con los objetos bala
Item *mItem[MAX_ITEMS]; // Vector con los objetos item
SmartSprite *mSmartSprite[MAX_SMART_SPRITES]; // Vector para almacenar y gestionar SmartSprites
LTexture *mTextureBalloon; // Textura para los enemigos
LTexture *mTextureBullet; // Textura para las balas
LTexture *mTextureGameBG; // Textura para el fondo del juego
LTexture *mTextureGameText; // Textura para los sprites con textos
LTexture *mTextureItems; // Textura para los items
LTexture *mTexturePlayerHead; // Textura para la cabeza del jugador
LTexture *mTexturePlayerBody; // Textura para el cuerpo del jugador
LTexture *mTexturePlayerDeath; // Textura para la animación de muerte del jugador
LTexture *mTexturePlayerLegs; // Textura para las piernas del jugador
LTexture *mTextureText; // Textura para el texto
LTexture *mTextureText2; // Textura para el texto
LTexture *mTextureBalloon; // Textura para los enemigos
LTexture *mTextureBullet; // Textura para las balas
LTexture *mTextureGameBG; // Textura para el fondo del juego
LTexture *mTextureGameText; // Textura para los sprites con textos
LTexture *mTextureItems; // Textura para los items
LTexture *mTexturePlayer1Head; // Textura para la cabeza del jugador1
LTexture *mTexturePlayer1Body; // Textura para el cuerpo del jugador1
LTexture *mTexturePlayer1Death; // Textura para la animación de muerte del jugador1
LTexture *mTexturePlayer1Legs; // Textura para las piernas del jugador
LTexture *mTexturePlayer2Head; // Textura para la cabeza del jugador2
LTexture *mTexturePlayer2Body; // Textura para el cuerpo del jugador2
LTexture *mTexturePlayer2Death; // Textura para la animación de muerte del jugador2
LTexture *mTexturePlayer2Legs; // Textura para las piernas del jugador
LTexture *mTextureText; // Textura para el texto
LTexture *mTextureText2; // Textura para el texto
Text *mText; // Variable con todos los objetos de texto
Text *mTextX2; // Variable con todos los objetos de texto
@@ -202,7 +207,7 @@ private:
public:
// Constructor
Game(SDL_Renderer *renderer, std::string *filelist, std::string *textStrings, Input *input, bool demo);
Game(int numPlayers, SDL_Renderer *renderer, std::string *filelist, std::string *textStrings, Input *input1, Input *input2, bool demo);
// Destructor
~Game();