I implemented the classic Tetris game. It requires Python 2 and the pygame library to run. I wrote it in Python 2.7.8 for UNIX-based operating systems, though it can be modified easily to run on Windows, too.
Once you have downloaded the Tetris folder, you can run the game with the included shell-script run.sh, i.e. type ./run.sh in your terminal. Instructions are included in the game.
It is possible for you to modify many aspects of the game, as the source code is included in the all subfolder. Some examples for modification:
- The easiest task is changing the colorscheme of the game: simply edit gameproperties.py in the appropriate places. Note that only hexadecimal color codes are admissible. Also note that the background for the game is saved as Grid.PNG. If you change the background color in gameproperties.py, then you'll need to run makecanvas.py once to generate an updated Grid.PNG. You can do that with the command python makecanvas.py.
- The game is built such that the level you are on determines how quickly blocks fall, and you advance a level for every ten lines you clear, so the difficulty increases very gradually. If you'd prefer constant difficulty, you can just change line 353 of tetris.py: set timeinterval to a constant, e.g. timeinterval = 0.5.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.