diff --git a/media/tilesets/standard.png b/media/tilesets/standard.png index 1aafe9e..7b40a74 100644 Binary files a/media/tilesets/standard.png and b/media/tilesets/standard.png differ diff --git a/media/tilesets/standard_zxarne.png b/media/tilesets/standard_zxarne.png new file mode 100644 index 0000000..1aafe9e Binary files /dev/null and b/media/tilesets/standard_zxarne.png differ diff --git a/source/game.cpp b/source/game.cpp index 29282f6..d49311c 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -7,8 +7,6 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input) clock = SDL_GetTicks(); currentRoom = "01.room"; spawnPoint = {2 * 8, 12 * 8, 0, 0, 0, s_standing, SDL_FLIP_NONE}; - spawnPoint = {154, 72, 0, 0, 0, s_standing, SDL_FLIP_NONE}; - debug = true; // Copia los punteros this->renderer = renderer; @@ -31,7 +29,10 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input) ticksSpeed = 15; playerLives = 9; itemsPicked = 0; - player->setInvincible(true); + + debug = true; + player->setInvincible(debug); + musicEnabled = !debug; section.name = SECTION_PROG_GAME; section.subsection = SUBSECTION_GAME_PLAY; @@ -89,6 +90,9 @@ void Game::checkEventHandler() case SDL_SCANCODE_D: debug = !debug; + player->setInvincible(debug); + musicEnabled = !debug; + musicEnabled ? JA_PlayMusic(music) : JA_StopMusic(); break; case SDL_SCANCODE_M: @@ -130,7 +134,10 @@ void Game::checkEventHandler() // Bucle para el juego section_t Game::run() { - JA_PlayMusic(music); + if (musicEnabled) + { + JA_PlayMusic(music); + } while (section.name == SECTION_PROG_GAME) { diff --git a/source/game.h b/source/game.h index 911d53c..2e33137 100644 --- a/source/game.h +++ b/source/game.h @@ -33,6 +33,7 @@ private: Text *debugText; // Objeto para los textos de debug del juego ScoreBoard *scoreboard; // Objeto encargado de gestionar el marcador JA_Music music; // Musica que suena durante el juego + bool musicEnabled; // Indica si ha de sonar la musica durante el juego int ticks; // Contador de ticks para ajustar la velocidad del programa int ticksSpeed; // Velocidad a la que se repiten los bucles del programa section_t section; // Seccion actual dentro del juego