forked from jaildesigner-jailgames/jaildoctors_dilemma
Arreglos en la estructura i format del codi
This commit is contained in:
@@ -32,13 +32,16 @@ Game::Game()
|
||||
scoreboard_(std::make_shared<Scoreboard>(board_)),
|
||||
room_tracker_(std::make_shared<RoomTracker>()),
|
||||
stats_(std::make_shared<Stats>(Asset::get()->get("stats.csv"), Asset::get()->get("stats_buffer.csv"))),
|
||||
// test_surface_(std::make_shared<Surface>(Screen::get()->getSurface(), "test.gif")),
|
||||
#ifdef DEBUG
|
||||
current_room_("03.room"),
|
||||
spawn_point_(PlayerSpawn(25 * BLOCK, 13 * BLOCK, 0, 0, 0, PlayerState::STANDING, SDL_FLIP_HORIZONTAL))
|
||||
#else
|
||||
current_room_("03.room"),
|
||||
spawn_point_(PlayerSpawn(25 * BLOCK, 13 * BLOCK, 0, 0, 0, PlayerState::STANDING, SDL_FLIP_HORIZONTAL))
|
||||
#endif
|
||||
{
|
||||
#ifdef DEBUG
|
||||
current_room_ = "03.room";
|
||||
spawn_point_ = PlayerSpawn(25 * BLOC, 13 * BLOCK, 0, 0, 0, PlayerState::STANDING, SDL_FLIP_HORIZONTAL);
|
||||
debug_->setEnabled(false);
|
||||
Debug::get()->setEnabled(false);
|
||||
#endif
|
||||
|
||||
// Crea objetos e inicializa variables
|
||||
@@ -127,7 +130,7 @@ void Game::update()
|
||||
checkInput();
|
||||
|
||||
#ifdef DEBUG
|
||||
debug_->clear();
|
||||
Debug::get()->clear();
|
||||
#endif
|
||||
|
||||
// Actualiza los objetos
|
||||
@@ -182,15 +185,15 @@ void Game::render()
|
||||
// Pasa la información de debug
|
||||
void Game::updateDebugInfo()
|
||||
{
|
||||
debug_->add("X = " + std::to_string(static_cast<int>(player_->x_)) + ", Y = " + std::to_string(static_cast<int>(player_->y_)));
|
||||
debug_->add("VX = " + std::to_string(player_->vx_).substr(0, 4) + ", VY = " + std::to_string(player_->vy_).substr(0, 4));
|
||||
debug_->add("STATE = " + std::to_string(static_cast<int>(player_->state_)));
|
||||
Debug::get()->add("X = " + std::to_string(static_cast<int>(player_->x_)) + ", Y = " + std::to_string(static_cast<int>(player_->y_)));
|
||||
Debug::get()->add("VX = " + std::to_string(player_->vx_).substr(0, 4) + ", VY = " + std::to_string(player_->vy_).substr(0, 4));
|
||||
Debug::get()->add("STATE = " + std::to_string(static_cast<int>(player_->state_)));
|
||||
}
|
||||
|
||||
// Pone la información de debug en pantalla
|
||||
void Game::renderDebugInfo()
|
||||
{
|
||||
if (!debug_->getEnabled())
|
||||
if (!Debug::get()->getEnabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -212,8 +215,8 @@ void Game::renderDebugInfo()
|
||||
}
|
||||
|
||||
// Pinta el texto
|
||||
debug_->setPos({1, 18 * 8});
|
||||
debug_->render();
|
||||
Debug::get()->setPos({1, 18 * 8});
|
||||
Debug::get()->render();
|
||||
}
|
||||
|
||||
// Comprueba los eventos
|
||||
@@ -639,7 +642,7 @@ void Game::checkEndGameCheevos()
|
||||
}
|
||||
|
||||
// Inicializa al jugador
|
||||
void Game::initPlayer(PlayerSpawn spawn_point, std::shared_ptr<Room> room)
|
||||
void Game::initPlayer(const PlayerSpawn &spawn_point, std::shared_ptr<Room> room)
|
||||
{
|
||||
std::string player_texture = options.cheats.alternate_skin == Cheat::CheatState::ENABLED ? "player2.png" : "player.png";
|
||||
std::string player_animations = options.cheats.alternate_skin == Cheat::CheatState::ENABLED ? "player2.ani" : "player.ani";
|
||||
|
||||
Reference in New Issue
Block a user