Cambiado el fichero de tiles con colores de zxspectrum

This commit is contained in:
2022-09-05 16:13:44 +02:00
parent 73d394388b
commit 0e91809429
4 changed files with 12 additions and 4 deletions

View File

@@ -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)
{