style: canvis en Game
This commit is contained in:
@@ -141,7 +141,7 @@ void Game::update()
|
||||
if (mode_ == GameMode::GAME)
|
||||
{
|
||||
player_->update();
|
||||
checkPlayerOnBorder();
|
||||
checkPlayerIsOnBorder();
|
||||
checkPlayerAndItems();
|
||||
checkPlayerAndEnemies();
|
||||
checkIfPlayerIsAlive();
|
||||
@@ -326,7 +326,7 @@ bool Game::changeRoom(const std::string &room_path)
|
||||
}
|
||||
|
||||
// Comprueba si el jugador esta en el borde de la pantalla
|
||||
void Game::checkPlayerOnBorder()
|
||||
void Game::checkPlayerIsOnBorder()
|
||||
{
|
||||
if (player_->getOnBorder())
|
||||
{
|
||||
@@ -661,6 +661,18 @@ void Game::createRoomNameTexture()
|
||||
room_name_rect_ = {0, PLAY_AREA_HEIGHT, options.game.width, text->getCharacterSize() * 2};
|
||||
}
|
||||
|
||||
// Hace sonar la música
|
||||
void Game::keepMusicPlaying()
|
||||
{
|
||||
const std::string music_path = mode_ == GameMode::GAME ? "game.ogg" : "title.ogg";
|
||||
|
||||
// Si la música no está sonando
|
||||
if (JA_GetMusicState() == JA_MUSIC_INVALID || JA_GetMusicState() == JA_MUSIC_STOPPED)
|
||||
{
|
||||
JA_PlayMusic(Resource::get()->getMusic(music_path));
|
||||
}
|
||||
}
|
||||
|
||||
// DEMO MODE: Inicializa las variables para el modo demo
|
||||
void Game::DEMO_init()
|
||||
{
|
||||
@@ -693,15 +705,3 @@ void Game::DEMO_checkRoomChange()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Hace sonar la música
|
||||
void Game::keepMusicPlaying()
|
||||
{
|
||||
const std::string music_path = mode_ == GameMode::GAME ? "game.ogg" : "title.ogg";
|
||||
|
||||
// Si la música no está sonando
|
||||
if (JA_GetMusicState() == JA_MUSIC_INVALID || JA_GetMusicState() == JA_MUSIC_STOPPED)
|
||||
{
|
||||
JA_PlayMusic(Resource::get()->getMusic(music_path));
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ private:
|
||||
void checkInput();
|
||||
|
||||
// Comprueba si el jugador esta en el borde de la pantalla y actua
|
||||
void checkPlayerOnBorder();
|
||||
void checkPlayerIsOnBorder();
|
||||
|
||||
// Comprueba las colisiones del jugador con los enemigos
|
||||
bool checkPlayerAndEnemies();
|
||||
@@ -151,15 +151,15 @@ private:
|
||||
// Crea la textura para poner el nombre de la habitación
|
||||
void createRoomNameTexture();
|
||||
|
||||
// Hace sonar la música
|
||||
void keepMusicPlaying();
|
||||
|
||||
// DEMO MODE: Inicializa las variables para el modo demo
|
||||
void DEMO_init();
|
||||
|
||||
// DEMO MODE: Comprueba si se ha de cambiar de habitación
|
||||
void DEMO_checkRoomChange();
|
||||
|
||||
// Hace sonar la música
|
||||
void keepMusicPlaying();
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
explicit Game(GameMode mode);
|
||||
|
||||
Reference in New Issue
Block a user