diff --git a/source/game.cpp b/source/game.cpp index b1671a1..e539a74 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -93,7 +93,7 @@ void Game::checkEventHandler() section.name = SECTION_PROG_TITLE; break; - case SDL_SCANCODE_D: + case SDL_SCANCODE_G: debug->switchEnabled(); options->cheat.invincible = debug->getEnabled(); board.music = !debug->getEnabled(); @@ -160,6 +160,22 @@ void Game::checkEventHandler() switchPalette(); break; + case SDL_SCANCODE_W: + goToRoom(BORDER_TOP); + break; + + case SDL_SCANCODE_A: + goToRoom(BORDER_LEFT); + break; + + case SDL_SCANCODE_S: + goToRoom(BORDER_BOTTOM); + break; + + case SDL_SCANCODE_D: + goToRoom(BORDER_RIGHT); + break; + default: break; } @@ -535,4 +551,14 @@ int Game::getTotalItems() } return items; +} + +// Va a la habitación designada +void Game::goToRoom(int border) +{ + const std::string roomName = room->getRoom(border); + if (changeRoom(roomName)) + { + currentRoom = roomName; + } } \ No newline at end of file diff --git a/source/game.h b/source/game.h index c048e61..427102e 100644 --- a/source/game.h +++ b/source/game.h @@ -117,6 +117,9 @@ private: // Obtiene la cantidad total de items que hay en el mapeado del juego int getTotalItems(); + // Va a la habitación designada + void goToRoom(int border); + public: // Constructor Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *asset, options_t *options, Input *input, Debug *debug); diff --git a/source/room.cpp b/source/room.cpp index a1387dc..ea9a47d 100644 --- a/source/room.cpp +++ b/source/room.cpp @@ -588,7 +588,7 @@ void Room::fillMapTexture() for (auto l : leftSurfaces) { SDL_SetRenderDrawColor(renderer, (rand() % 128) + 96, (rand() % 128) + 96, (rand() % 128) + 96, 0xFF); - SDL_SetRenderDrawColor(renderer, 0, 0, 255, 0xFF); + SDL_SetRenderDrawColor(renderer, 128, 128, 255, 0xFF); SDL_RenderDrawLine(renderer, l.x, l.y1, l.x, l.y2); } }