# Thymio Game A competitive game in groups with Thymio. The teams have to create a program to reach the goal as fast as possible while avoiding obstacles. ## Running the game The game needs at least Python 3.6. Install it by running these commands (the project depends on pyqt5 so installing the requirements can be quite long): ```bash git clone https://gitlab.laas.fr/tpillot/thymio-game.git cd thymio-game python -m venv venv . venv/bin/activate pip install -r requirements.txt ``` And run it with: ```bash python main.py ``` ## Preparation Print the tags provided in [apriltags.pdf](apriltags.pdf) and put a tag on each Thymio with the corresponding color. The activity is meant to be used with VPL, or the automated start won't work. It is also necessary to prepare the ground for the race, the ideal would be to have a start line where the Thymios can be positioned, a finish line, and a path with curves and obstacles in between. ## Choosing a webcam The first window opened gives you the ability to choose one of your available webcams. The webcam you choose will be used to scan the tags to register the teams and to detect when a team has reached the goal. When you are happy with the selected webcam, click the validate button. ![](images/webcam_chooser.png) ## Register the teams You will then be able to register the teams before starting the activity, each team needs to put its name and scan the tag on its Thymio. Then you can choose an activity and the time of the activity, and press the start button to show the scoreboard. ![](images/team_chooser.png) ## Scoreboard The scoreboard window has a timer, an event history, and a webcam highlighting detected tags in real time. The webcam should be placed so that it films the place the Thymios have to reach in order to win points. To start the scoreboard and all Thymios at the same time, you first need to press the blue start button to allow the teams to join the automated start. ![](images/scoreboard.png) At this point, all teams have to click on the **Join activity** button on VPL which will first ask them to save their work. ![](images/vpl.png) Then VPL should display a message saying that the program is waiting for the activity to start. VPL will be unresponsive until the activity is started. ![](images/vpl2.png) When all the teams have this message, you can start running all Thymios at the same time by pressing the green start button. ![](images/scoreboard2.png) When the Thymios and the timer start running, the scoreboard is active and each time the webcam detects a tag, the corresponding team will win points. The amount of points won depends on the time taken to complete the race.