A simple app using three ROS nodes named:
keyboard_readerreads keyboard input from terminalgame_displayshows the game in a windowgame_controllerhandles game logic
Currently there is no purpose in game. Player can just move around the map.
To move the player use "awsd" in terminal running keyboard_reader node.
The game window looks like:
sudo apt install cmake libsdl2-dev g++ libncurses5-dev libncursesw5-devBuild the app first
# from ros2 workspace
. install/local_setup.bash
colcon build --packages-select ros_gameThen run the app in three separate terminals, remember to source the environment
# in first terminal
. install/local_setup.bash
ros2 run ros_game keyboard_reader
# to exit this node press 'q'# in second terminal
. install/local_setup.bash
ros2 run ros_game game_display
# to exit use ctrl + c# in third terminal (run always after game_display)
. install/local_setup.bash
ros2 run ros_game game_controller
# to exit use ctrl + c