- es pot canviar d'habitacio amb el editor obert

- nous comandos per a navegar per les habitacions (left, right, up i down)
This commit is contained in:
2026-04-02 11:38:46 +02:00
parent eca5a55d3c
commit 0e61b94848
4 changed files with 69 additions and 11 deletions

View File

@@ -133,6 +133,13 @@ Game::Game(Mode mode)
GameControl::revert_editor = []() -> std::string {
return MapEditor::get()->revert();
};
GameControl::get_adjacent_room = [this](const std::string& direction) -> std::string {
if (direction == "UP") { return room_->getRoom(Room::Border::TOP); }
if (direction == "DOWN") { return room_->getRoom(Room::Border::BOTTOM); }
if (direction == "LEFT") { return room_->getRoom(Room::Border::LEFT); }
if (direction == "RIGHT") { return room_->getRoom(Room::Border::RIGHT); }
return "0";
};
#endif
SceneManager::current = (mode_ == Mode::GAME) ? SceneManager::Scene::GAME : SceneManager::Scene::DEMO;
@@ -158,6 +165,7 @@ Game::~Game() {
GameControl::exit_editor = nullptr;
GameControl::revert_editor = nullptr;
GameControl::reload_current_room = nullptr;
GameControl::get_adjacent_room = nullptr;
#endif
}