OUR EXPERT
Andrew Smith is a software developer at NHS Digital, and has qualifications in software engineering and computer networking.
T his month, we going to look at a Tetris project that’s been written in Python, and then add code to support an Xbox One controller. In theory, the code should work with other PC-based compatible controllers, but they’ve not been tested for this tutorial and so may require some adjustments and configuration changes. Your millage may vary!
Before starting this tutorial, we advise plugging your game controller (if you have one) into your computer and making sure that it works with your distro of Linux (we’re using Ubuntu). This tutorial is based on a Tetris project originally created by Luke Arnston – see www.pygame.org/project/133/166.
Tetris, a graphical puzzle game first created in 1984 by Alexey Pajitnov, it has since become available on multiple platforms and implemented using a range of programming languages. One of the most popular platforms that this video game was available on was the Nintendo Game Boy, which was released in the late 80s/early 90s. The Game Boy was a relatively cheap, hand-held device that could be easily packed away and taken and played anywhere.
involves players creating lines from shapes (Tetronimoes) that descend gradually into the game playing area. These shapes can also be manipulated (moved left to right and rotated) to fit in with other shapes to create a complete line. Once a complete line is created, the line then