forked from jaildesigner-jailgames/jaildoctors_dilemma
style: arreglades capçaleres
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
#include "utils/utils.hpp" // Para PaletteColor, stringToColor
|
||||
|
||||
// Constructor
|
||||
Game::Game(GameMode mode)
|
||||
Game::Game(Mode mode)
|
||||
: board_(std::make_shared<ScoreboardData>(0, 9, 0, true, 0, SDL_GetTicks(), Options::cheats.jail_is_open == Options::Cheat::State::ENABLED)),
|
||||
scoreboard_(std::make_shared<Scoreboard>(board_)),
|
||||
room_tracker_(std::make_shared<RoomTracker>()),
|
||||
@@ -60,7 +60,7 @@ Game::Game(GameMode mode)
|
||||
Cheevos::get()->enable(!Options::cheats.enabled()); // Deshabilita los logros si hay trucos activados
|
||||
Cheevos::get()->clearUnobtainableState();
|
||||
|
||||
SceneManager::current = (mode_ == GameMode::GAME) ? SceneManager::Scene::GAME : SceneManager::Scene::DEMO;
|
||||
SceneManager::current = (mode_ == Mode::GAME) ? SceneManager::Scene::GAME : SceneManager::Scene::DEMO;
|
||||
SceneManager::options = SceneManager::Options::NONE;
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ void Game::checkInput() {
|
||||
// Bucle para el juego
|
||||
void Game::run() {
|
||||
keepMusicPlaying();
|
||||
if (!board_->music && mode_ == GameMode::GAME) {
|
||||
if (!board_->music && mode_ == Mode::GAME) {
|
||||
JA_PauseMusic();
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ void Game::run() {
|
||||
render();
|
||||
}
|
||||
|
||||
if (mode_ == GameMode::GAME) {
|
||||
if (mode_ == Mode::GAME) {
|
||||
JA_StopMusic();
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,7 @@ void Game::update() {
|
||||
|
||||
// Actualiza los objetos
|
||||
room_->update(DELTA_TIME);
|
||||
if (mode_ == GameMode::GAME) {
|
||||
if (mode_ == Mode::GAME) {
|
||||
player_->update(DELTA_TIME);
|
||||
checkPlayerIsOnBorder();
|
||||
checkPlayerAndItems();
|
||||
@@ -159,7 +159,7 @@ void Game::render() {
|
||||
room_->renderMap();
|
||||
room_->renderEnemies();
|
||||
room_->renderItems();
|
||||
if (mode_ == GameMode::GAME) {
|
||||
if (mode_ == Mode::GAME) {
|
||||
player_->render();
|
||||
}
|
||||
renderRoomName();
|
||||
@@ -584,7 +584,7 @@ void Game::createRoomNameTexture() {
|
||||
|
||||
// Hace sonar la música
|
||||
void Game::keepMusicPlaying() {
|
||||
const std::string MUSIC_PATH = mode_ == GameMode::GAME ? "game.ogg" : "title.ogg";
|
||||
const std::string MUSIC_PATH = mode_ == Mode::GAME ? "game.ogg" : "title.ogg";
|
||||
|
||||
// Si la música no está sonando
|
||||
if (JA_GetMusicState() == JA_MUSIC_INVALID || JA_GetMusicState() == JA_MUSIC_STOPPED) {
|
||||
@@ -594,7 +594,7 @@ void Game::keepMusicPlaying() {
|
||||
|
||||
// DEMO MODE: Inicializa las variables para el modo demo
|
||||
void Game::demoInit() {
|
||||
if (mode_ == GameMode::DEMO) {
|
||||
if (mode_ == Mode::DEMO) {
|
||||
demo_ = DemoData(0.0F, 0, {"04.room", "54.room", "20.room", "09.room", "05.room", "11.room", "31.room", "44.room"});
|
||||
current_room_ = demo_.rooms.front();
|
||||
}
|
||||
@@ -602,7 +602,7 @@ void Game::demoInit() {
|
||||
|
||||
// DEMO MODE: Comprueba si se ha de cambiar de habitación
|
||||
void Game::demoCheckRoomChange(float delta_time) {
|
||||
if (mode_ == GameMode::DEMO) {
|
||||
if (mode_ == Mode::DEMO) {
|
||||
demo_.time_accumulator += delta_time;
|
||||
if (demo_.time_accumulator >= DEMO_ROOM_DURATION) {
|
||||
demo_.time_accumulator = 0.0F;
|
||||
|
||||
Reference in New Issue
Block a user