diff --git a/demo/include/utils/pacman_wrapper.hpp b/demo/include/utils/pacman_wrapper.hpp index 0c5b2c93..93806374 100644 --- a/demo/include/utils/pacman_wrapper.hpp +++ b/demo/include/utils/pacman_wrapper.hpp @@ -27,6 +27,8 @@ class PacmanWrapper { return game_; } + void printKeybindings(); + private: void handleUserInput(); void renderPath(const demo::Positions& path); diff --git a/demo/src/main.cpp b/demo/src/main.cpp index 70df2ffc..2dfcd771 100644 --- a/demo/src/main.cpp +++ b/demo/src/main.cpp @@ -15,6 +15,8 @@ using namespace arbitration_graphs; int main() { try { PacmanWrapper demo; + demo.printKeybindings(); + PacmanAgent agent(demo.game()); gui::WebServer server(8080, true); diff --git a/demo/src/pacman_wrapper.cpp b/demo/src/pacman_wrapper.cpp index d42b9ae5..7ff832e0 100644 --- a/demo/src/pacman_wrapper.cpp +++ b/demo/src/pacman_wrapper.cpp @@ -1,5 +1,7 @@ #include "utils/pacman_wrapper.hpp" +#include + #include #include @@ -108,6 +110,18 @@ void PacmanWrapper::progressGame(const demo::Command& command, FrameCap sync{fps}; } +void PacmanWrapper::printKeybindings() { + std::cout << "\n" + << "\033[1;36m=====================================\033[0m\n" + << "\033[1;37m CONTROLS \033[0m\n" + << "\033[1;36m=====================================\033[0m\n" + << " \033[1;32mESC/Q\033[0m - Quit the demo\n" + << " \033[1;32mSpace\033[0m - Pause the demo\n" + << " \033[1;32mP\033[0m - Toggle path visualization\n" + << "\033[1;36m=====================================\033[0m\n" + << std::endl; +} + void PacmanWrapper::renderPath(const demo::Positions& path) { // Set path color and transparency SDL_CHECK(SDL_SetRenderDrawColor(renderer_.get(), 0, 255, 0, 90));