Actualizado .gitignore

This commit is contained in:
2022-10-05 13:02:57 +02:00
parent f5ba15a4af
commit 901757b9b2
4 changed files with 53 additions and 44 deletions

1
.gitignore vendored
View File

@@ -2,4 +2,5 @@
*.DS_Store
bin
data/config.txt
data/config.bin
data/score.bin

View File

@@ -10,7 +10,6 @@ Game::Game(int numPlayers, int currentStage, SDL_Renderer *renderer, Screen *scr
this->lang = lang;
this->input = input;
this->options = options;
onePlayerControl = options->input[0].deviceType;
// Pasa variables
this->demo.enabled = demo;
@@ -18,48 +17,23 @@ Game::Game(int numPlayers, int currentStage, SDL_Renderer *renderer, Screen *scr
this->currentStage = 5; // currentStage;
lastStageReached = currentStage;
if (numPlayers == 1)
{
{ // Si solo juega un jugador, permite jugar tanto con teclado como con mando
onePlayerControl = options->input[0].deviceType;
options->input[0].deviceType = INPUT_USE_ANY;
}
difficulty = options->difficulty;
// Crea los objetos
balloon1Texture = new LTexture(renderer, asset->get("balloon1.png"));
balloon2Texture = new LTexture(renderer, asset->get("balloon2.png"));
balloon3Texture = new LTexture(renderer, asset->get("balloon3.png"));
balloon4Texture = new LTexture(renderer, asset->get("balloon4.png"));
bulletTexture = new LTexture(renderer, asset->get("bullet.png"));
gameBuildingsTexture = new LTexture(renderer, asset->get("game_buildings.png"));
gameCloudsTexture = new LTexture(renderer, asset->get("game_clouds.png"));
gameGrassTexture = new LTexture(renderer, asset->get("game_grass.png"));
gamePowerMeterTexture = new LTexture(renderer, asset->get("game_power_meter.png"));
gameSkyColorsTexture = new LTexture(renderer, asset->get("game_sky_colors.png"));
gameTextTexture = new LTexture(renderer, asset->get("game_text.png"));
itemTexture = new LTexture(renderer, asset->get("items.png"));
balloon1Animation = new std::vector<std::string>;
balloon2Animation = new std::vector<std::string>;
balloon3Animation = new std::vector<std::string>;
balloon4Animation = new std::vector<std::string>;
loadAnimations(asset->get("balloon1.ani"), balloon1Animation);
loadAnimations(asset->get("balloon2.ani"), balloon2Animation);
loadAnimations(asset->get("balloon3.ani"), balloon3Animation);
loadAnimations(asset->get("balloon4.ani"), balloon4Animation);
text = new Text(asset->get("smb2.png"), asset->get("smb2.txt"), renderer);
textScoreBoard = new Text(asset->get("8bithud.png"), asset->get("8bithud.txt"), renderer);
textBig = new Text(asset->get("smb2_big.png"), asset->get("smb2_big.txt"), renderer);
textNokia2 = new Text(asset->get("nokia2.png"), asset->get("nokia2.txt"), renderer);
textNokiaBig2 = new Text(asset->get("nokia_big2.png"), asset->get("nokia_big2.txt"), renderer);
gameOverMenu = new Menu(renderer, asset, input, asset->get("gameover.men"));
pauseMenu = new Menu(renderer, asset, input, asset->get("pause.men"));
fade = new Fade(renderer);
eventHandler = new SDL_Event();
// Carga los recursos
loadMedia();
clouds1A = new MovingSprite(0, 0, 256, 52, -0.4f, 0.0f, 0.0f, 0.0f, gameCloudsTexture, renderer);
clouds1B = new MovingSprite(256, 0, 256, 52, -0.4f, 0.0f, 0.0f, 0.0f, gameCloudsTexture, renderer);
clouds2A = new MovingSprite(0, 52, 256, 32, -0.2f, 0.0f, 0.0f, 0.0f, gameCloudsTexture, renderer);
@@ -75,6 +49,11 @@ Game::Game(int numPlayers, int currentStage, SDL_Renderer *renderer, Screen *scr
grassSprite = new Sprite(0, 0, 256, 6, gameGrassTexture, renderer);
powerMeterSprite = new Sprite(PLAY_AREA_CENTER_X - 20, 170, 40, 7, gamePowerMeterTexture, renderer);
// Carga ficheros
loadScoreFile();
loadDemoFile();
// Inicializa las variables necesarias para la sección 'Game'
init();
}
@@ -84,7 +63,11 @@ Game::~Game()
saveScoreFile();
saveDemoFile();
options->input[0].deviceType = onePlayerControl;
// Restaura el metodo de control
if (numPlayers == 1)
{
options->input[0].deviceType = onePlayerControl;
}
// Elimina todos los objetos contenidos en vectores
deleteAllVectorObjects();
@@ -174,13 +157,6 @@ Game::~Game()
// Inicializa las variables necesarias para la sección 'Game'
void Game::init()
{
// Carga los recursos
loadMedia();
// Carga ficheros
loadScoreFile();
loadDemoFile();
ticks = 0;
ticksSpeed = 15;
@@ -357,9 +333,40 @@ void Game::init()
}
// Carga los recursos necesarios para la sección 'Game'
bool Game::loadMedia()
void Game::loadMedia()
{
bool success = true;
std::cout << "** LOADING RESOURCES FOR GAME SECTION" << std::endl;
// Texturas
balloon1Texture = new LTexture(renderer, asset->get("balloon1.png"));
balloon2Texture = new LTexture(renderer, asset->get("balloon2.png"));
balloon3Texture = new LTexture(renderer, asset->get("balloon3.png"));
balloon4Texture = new LTexture(renderer, asset->get("balloon4.png"));
bulletTexture = new LTexture(renderer, asset->get("bullet.png"));
gameBuildingsTexture = new LTexture(renderer, asset->get("game_buildings.png"));
gameCloudsTexture = new LTexture(renderer, asset->get("game_clouds.png"));
gameGrassTexture = new LTexture(renderer, asset->get("game_grass.png"));
gamePowerMeterTexture = new LTexture(renderer, asset->get("game_power_meter.png"));
gameSkyColorsTexture = new LTexture(renderer, asset->get("game_sky_colors.png"));
gameTextTexture = new LTexture(renderer, asset->get("game_text.png"));
itemTexture = new LTexture(renderer, asset->get("items.png"));
// Animaciones
loadAnimations(asset->get("balloon1.ani"), balloon1Animation);
loadAnimations(asset->get("balloon2.ani"), balloon2Animation);
loadAnimations(asset->get("balloon3.ani"), balloon3Animation);
loadAnimations(asset->get("balloon4.ani"), balloon4Animation);
// Texto
text = new Text(asset->get("smb2.png"), asset->get("smb2.txt"), renderer);
textScoreBoard = new Text(asset->get("8bithud.png"), asset->get("8bithud.txt"), renderer);
textBig = new Text(asset->get("smb2_big.png"), asset->get("smb2_big.txt"), renderer);
textNokia2 = new Text(asset->get("nokia2.png"), asset->get("nokia2.txt"), renderer);
textNokiaBig2 = new Text(asset->get("nokia_big2.png"), asset->get("nokia_big2.txt"), renderer);
// Menus
gameOverMenu = new Menu(renderer, asset, input, asset->get("gameover.men"));
pauseMenu = new Menu(renderer, asset, input, asset->get("pause.men"));
// Sonidos
balloonSound = JA_LoadSound(asset->get("balloon.wav").c_str());
@@ -381,7 +388,7 @@ bool Game::loadMedia()
// Musicas
gameMusic = JA_LoadMusic(asset->get("playing.ogg").c_str());
return success;
std::cout << "** RESOURCES FOR GAME SECTION LOADED" << std::endl << std::endl;
}
// Carga el fichero de puntos

View File

@@ -245,7 +245,7 @@ private:
void init();
// Carga los recursos necesarios para la sección 'Game'
bool loadMedia();
void loadMedia();
// Carga el fichero de puntos
bool loadScoreFile();

View File

@@ -20,4 +20,5 @@ x no pone la animacion corecta al no disparar con el powerup
que grite "yiiijaa!" o algo parecido al coger la maquina de cafe
o que diga DIMONIS! en un globo de texto que se evapore
podrian salir comentarios aleatoriamente o con ciertos eventos (falta ver si no estorbará)
que se vea el nivel de dificultad
que se vea el nivel de dificultad
cargar y guardar la configuración