A simple app using three ROS nodes named:
keyboard_reader
reads keyboard input from terminalgame_display
shows the game in a windowgame_controller
handles 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-dev
Build the app first
# from ros2 workspace
. install/local_setup.bash
colcon build --packages-select ros_game
Then 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