The TFT display and touchscreen of the PiStorms module is an incredibly powerful asset. The PiStorms has a built in file browser, that allows the user to create interactive menus, applications, and even exciting games.
Catching Mike - demo game
In this demo game, try to catch Mike (a small smiley face which bounces around the screen) by tapping him with your finger. In beginning it’s a simple game, but as the score builds Mike shrinks and the pace increases. Catch Mike 50 times and make him surrender! Players also have the ability to modify the game by changing the python code. Have fun playing and learning with Mike!
This entire build can be achieved with nothing more than the PiStorms starter kit and a Raspberry Pi. Even without any of the NXT or EV3 peripherals, the applications of the PiStorms are boundless.
Python program logic:
Catching Mike is a simple program. An image is displayed at random X and Y coordinates every time a loop is cycled. In addition to the image, an invisible box is drawn around the image, using the same random coordinates. When the program detects that the user has touched the box, Mike is considered caught, and the screen displays a “you caught me” message. A small score box in the bottom left increments as the user catches Mike over and over again.
As added flair, the pair of LEDs on the top of the PiStorms flash equal to the player’s score. As your score increases, the versatile PiStorms python API will shrink the elusive character. Mike continues on his escape plan, only to inevitably be caught again until the score reaches 50. Then mike surrenders and the player wins!
The Catching Mike program is included in the PiStorms distribution folder.
Also, you can download only the Catching Mike python code here.