by Petr Khromov
In this project, Petr created a game robot (gamebot) to simulate a human playing the game. The point of the game is to survive 64 seconds while shooting squares that are the same color as a background (bad guys) while not shooting squares of different colors (good guys). It becomes increasingly difficult to survive more than 64 seconds after each game level increase. In the endless mode of this game, all these different mechanics are mixed.
This project involves OpenCV and Pthreads. One thread is taking screenshots of the game, using OpenCV to analyze shapes, sort out the ones that are not rectangles, wrong size, duplicates, or in unusual parts of the screen then analyze the color of the square. The second thread calculates the speed of the squares and determines when to shoot bad guys without shooting good guys. Lastly, the second thread double checks if the bad guy actually died (the game had a bug where bad guys were still alive after getting shot).
The game robot now holds the world record all-time best score.