feat: add logic that allows piece to move

This commit is contained in:
2021-06-03 15:11:37 -04:00
parent 9b48f3b347
commit 5f20bf5552
3 changed files with 16 additions and 8 deletions

View File

@@ -35,9 +35,15 @@ class Piece:
for sub_points in self.points:
pygame.draw.polygon(surface, base_color, sub_points, 0)
pygame.draw.polygon(surface, border_color, sub_points, max(tile_size // 6, 1))
def move(self, vector):
for sub_points in self.points:
for point in sub_points:
point[0] += vector[0]
point[1] += vector[1]
# rotate the piece clockwise
def rotate():
def rotate(self):
pass
# shape attributes