Terminal-bounded block-based puzzle game written in Python/Curses
This game is dedicated to Alexey Pajitnov, original author of Tetris. This version features:
The goal is simple: rotate and move pieces as they fall, line up ten blocks in a row to clear a row, and keep going until the board tops out.
(Banner picture depicts the game running in Cool Retro Term, found here)
.py
files, run python cursatetra.py
windows-curses
(Just needed extra entries in the cellValues dictionary because the color attributes are encoded differently in windows-curses
)undraw()
method on a piece, specifically during an invocation of move()
on said piece, would cause the piece's color data to remain behind, causing the blank space to not register as such. This was game breaking. Was fixed by ensuring that a Curses color_pair
is passed to the calls of addch()
in the drawPiece()
method. In particular, color_pair
0 is passed for when cells are to be made blank via invoking undraw()
settings.json
Valid Constructor Values:
Methods & Valid Values:
Note: The orientation of the pieces may seem backwards at first glance; Consider it in terms of the orientation of an underline below the text character that identifies a piece
C : Square
012345
.[][]
.[][]
.
S : S-piece
012345
.
. [][]
.[][]
012345
.[]
.[][]
. []
Z : Z-piece
012345
.
.[][]
. [][]
012345
. []
.[][]
.[]
L : L-piece
012345
. []
. []
. [][]
012345
.
.[][][]
.[]
012345
.[][]
. []
. []
012345
. []
.[][][]
.
R : Reversed L-piece
012345
. []
. []
.[][]
012345
.[]
.[][][]
.
012345
. [][]
. []
. []
012345
.
.[][][]
. []
I : Line
01234567
. []
. []
. []
. []
01234567
.
.
.[][][][]
.
T : T-piece
012345
.
.[][][]
. []
012345
. []
.[][]
. []
012345
. []
.[][][]
.
012345
. []
. [][]
. []