This is a Tetris game with a heuristic-driven AI player. Rather than Python 3.6
, everything is written is Python 2.7
due to poor performance of pygame-c36
on Mac OS.
Part of this Tetris game is based on this non-AI version. This project simplified that example and implemented the AI.
Requires pygame
(which isn't on pip). You can download here. Apart from this, requires copy
, threading
, random
and collections
.
How to install and open the game:
git clone https://github.com/allenfrostline/Tetris-AI
cd Tetris-AI-master
python2.7 tetris.py
How to play the game:
KEY | COMMAND |
---|---|
Down | Drop stone faster |
Left / Right | Move stone |
Up | Rotate stone clockwise |
Escape | Quit this round of game |
P | Toggle the instant mode for AI |
Q | Exit the whole game |
Return | Manual instant drop |
Space | Replay the game |
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :-)
Well if you insist, I'd really like to tell you an old story about a Russian video game designer called Alexey Pajitnov...