From 2c19289f36015a1a8d8aa15d9c4a655f58fc6028 Mon Sep 17 00:00:00 2001 From: Giovani Date: Thu, 3 Jun 2021 17:01:34 -0400 Subject: [PATCH] chore: add information on piece rotation --- entity/Piece.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/entity/Piece.py b/entity/Piece.py index 0c1d9ff..8a59055 100644 --- a/entity/Piece.py +++ b/entity/Piece.py @@ -49,7 +49,10 @@ class Piece: # TODO game objects base class / interface? point[0] += vector[0] point[1] += vector[1] - # rotate the piece clockwise + ''' + For more information on a rotation of a piece go here: + https://gamedev.stackexchange.com/questions/17974/how-to-rotate-blocks-in-tetris + ''' def rotate(self): for sub_points in self.points: for point in sub_points: @@ -60,4 +63,5 @@ class Piece: # TODO game objects base class / interface? point[1] = (h * -1) + self.center[1] # shape attributes - I_SHAPE = (((0, 0), (1, 0), (1, 1), (0, 1)), ((1, 0), (2, 0), (2, 1), (1, 1)), ((2, 0, True), (3, 0), (3, 1), (2, 1)), ((3, 0), (4, 0), (4, 1), (3, 1))) \ No newline at end of file + I_SHAPE = (((0, 0), (1, 0), (1, 1), (0, 1)), ((1, 0), (2, 0), (2, 1), (1, 1)), ((2, 0, True), (3, 0), (3, 1), (2, 1)), ((3, 0), (4, 0), (4, 1), (3, 1))) + O_PIECE = ()