forked from jaildesigner-jailgames/jaildoctors_dilemma
style: corregides les capçaleres de game/entities
This commit is contained in:
@@ -36,7 +36,7 @@ Game::Game(GameMode mode)
|
||||
mode_(mode),
|
||||
#ifdef _DEBUG
|
||||
current_room_("03.room"),
|
||||
spawn_point_(PlayerSpawn(25 * BLOCK, 13 * BLOCK, 0, 0, 0, PlayerState::STANDING, SDL_FLIP_HORIZONTAL))
|
||||
spawn_data_(Player::SpawnData(25 * BLOCK, 13 * BLOCK, 0, 0, 0, Player::State::STANDING, SDL_FLIP_HORIZONTAL))
|
||||
#else
|
||||
current_room_("03.room"),
|
||||
spawn_point_(PlayerSpawn(25 * BLOCK, 13 * BLOCK, 0, 0, 0, PlayerState::STANDING, SDL_FLIP_HORIZONTAL))
|
||||
@@ -50,7 +50,7 @@ Game::Game(GameMode mode)
|
||||
ItemTracker::init();
|
||||
demoInit();
|
||||
room_ = std::make_shared<Room>(current_room_, board_);
|
||||
initPlayer(spawn_point_, room_);
|
||||
initPlayer(spawn_data_, room_);
|
||||
initStats();
|
||||
total_items_ = getTotalItems();
|
||||
|
||||
@@ -178,9 +178,9 @@ void Game::render() {
|
||||
#ifdef _DEBUG
|
||||
// Pasa la información de debug
|
||||
void Game::updateDebugInfo() {
|
||||
//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_)));
|
||||
// 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
|
||||
@@ -305,7 +305,7 @@ void Game::checkPlayerIsOnBorder() {
|
||||
const std::string ROOM_NAME = room_->getRoom(player_->getBorder());
|
||||
if (changeRoom(ROOM_NAME)) {
|
||||
player_->switchBorders();
|
||||
spawn_point_ = player_->getSpawnParams();
|
||||
spawn_data_ = player_->getSpawnParams();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -363,7 +363,7 @@ void Game::killPlayer() {
|
||||
|
||||
// Crea la nueva habitación y el nuevo jugador
|
||||
room_ = std::make_shared<Room>(current_room_, board_);
|
||||
initPlayer(spawn_point_, room_);
|
||||
initPlayer(spawn_data_, room_);
|
||||
|
||||
// Pone los objetos en pausa mientras esta la habitación en negro
|
||||
room_->setPaused(true);
|
||||
@@ -566,10 +566,10 @@ void Game::checkEndGameCheevos() {
|
||||
}
|
||||
|
||||
// Inicializa al jugador
|
||||
void Game::initPlayer(const PlayerSpawn& spawn_point, std::shared_ptr<Room> room) {
|
||||
void Game::initPlayer(const Player::SpawnData& spawn_point, std::shared_ptr<Room> room) {
|
||||
std::string player_texture = Options::cheats.alternate_skin == Options::Cheat::State::ENABLED ? "player2.gif" : "player.gif";
|
||||
std::string player_animations = Options::cheats.alternate_skin == Options::Cheat::State::ENABLED ? "player2.ani" : "player.ani";
|
||||
const PlayerData PLAYER(spawn_point, player_texture, player_animations, std::move(room));
|
||||
const Player::Data PLAYER(spawn_point, player_texture, player_animations, std::move(room));
|
||||
player_ = std::make_shared<Player>(PLAYER);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user