forked from jaildesigner-jailgames/jaildoctors_dilemma
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()
|
||||
{
|
||||
@@ -692,16 +704,4 @@ 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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user