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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

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

View File

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