Cambiado el fichero de tiles con colores de zxspectrum
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.2 KiB |
BIN
media/tilesets/standard_zxarne.png
Normal file
BIN
media/tilesets/standard_zxarne.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
@@ -7,8 +7,6 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input)
|
|||||||
clock = SDL_GetTicks();
|
clock = SDL_GetTicks();
|
||||||
currentRoom = "01.room";
|
currentRoom = "01.room";
|
||||||
spawnPoint = {2 * 8, 12 * 8, 0, 0, 0, s_standing, SDL_FLIP_NONE};
|
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
|
// Copia los punteros
|
||||||
this->renderer = renderer;
|
this->renderer = renderer;
|
||||||
@@ -31,7 +29,10 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Asset *asset, Input *input)
|
|||||||
ticksSpeed = 15;
|
ticksSpeed = 15;
|
||||||
playerLives = 9;
|
playerLives = 9;
|
||||||
itemsPicked = 0;
|
itemsPicked = 0;
|
||||||
player->setInvincible(true);
|
|
||||||
|
debug = true;
|
||||||
|
player->setInvincible(debug);
|
||||||
|
musicEnabled = !debug;
|
||||||
|
|
||||||
section.name = SECTION_PROG_GAME;
|
section.name = SECTION_PROG_GAME;
|
||||||
section.subsection = SUBSECTION_GAME_PLAY;
|
section.subsection = SUBSECTION_GAME_PLAY;
|
||||||
@@ -89,6 +90,9 @@ void Game::checkEventHandler()
|
|||||||
|
|
||||||
case SDL_SCANCODE_D:
|
case SDL_SCANCODE_D:
|
||||||
debug = !debug;
|
debug = !debug;
|
||||||
|
player->setInvincible(debug);
|
||||||
|
musicEnabled = !debug;
|
||||||
|
musicEnabled ? JA_PlayMusic(music) : JA_StopMusic();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_SCANCODE_M:
|
case SDL_SCANCODE_M:
|
||||||
@@ -130,7 +134,10 @@ void Game::checkEventHandler()
|
|||||||
// Bucle para el juego
|
// Bucle para el juego
|
||||||
section_t Game::run()
|
section_t Game::run()
|
||||||
{
|
{
|
||||||
JA_PlayMusic(music);
|
if (musicEnabled)
|
||||||
|
{
|
||||||
|
JA_PlayMusic(music);
|
||||||
|
}
|
||||||
|
|
||||||
while (section.name == SECTION_PROG_GAME)
|
while (section.name == SECTION_PROG_GAME)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ private:
|
|||||||
Text *debugText; // Objeto para los textos de debug del juego
|
Text *debugText; // Objeto para los textos de debug del juego
|
||||||
ScoreBoard *scoreboard; // Objeto encargado de gestionar el marcador
|
ScoreBoard *scoreboard; // Objeto encargado de gestionar el marcador
|
||||||
JA_Music music; // Musica que suena durante el juego
|
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 ticks; // Contador de ticks para ajustar la velocidad del programa
|
||||||
int ticksSpeed; // Velocidad a la que se repiten los bucles del programa
|
int ticksSpeed; // Velocidad a la que se repiten los bucles del programa
|
||||||
section_t section; // Seccion actual dentro del juego
|
section_t section; // Seccion actual dentro del juego
|
||||||
|
|||||||
Reference in New Issue
Block a user