tetris implemented using pygame There are three modes to play, single play, online play and cpu play. Note that server should be deployed at some place if you want to play online mode.
Menu Screen Single Play Online Play Play with AI
This version of tetris basically follows the rule from Tetris DS. Super Rotation System is used to determine how each rotation affects the current mino's position.
python tetris.py
To play online mode, you should edit network configuration in src/server/main.go, src/network_config.py, and deploy the execution file created by following command.
go build
To play the mode of challenge AI, make sure there is a pit file in the same directory as tetris.py. The default pit file, tetris-best_475.pit, is the model trained by here.
pygame numpy torch gym
a ... move left
s ... move right
w ... hard drop
z ... soft drop
space bar ... hold
right arrow ... rotate clockwise
left arrow ... rotate counterclockwise
This software is released under the MIT License, see LICENSE.txt.