feat: add ability to move piece with arrow keys

This commit is contained in:
Giovani Rodriguez
2021-06-03 15:37:25 -04:00
parent 5971f7a73d
commit 42e552d414
3 changed files with 27 additions and 19 deletions

View File

@@ -6,7 +6,7 @@ from util.ConfigurationManager import ConfigurationManager
For information on the Tetris piece Tetromino go here:
https://tetris.fandom.com/wiki/Tetromino
'''
class Piece:
class Piece: # TODO game objects base class / interface?
def __init__(self, shape, position, color):
self.color = color
@@ -27,9 +27,9 @@ class Piece:
def draw(self, surface):
tile_size = ConfigurationManager.configuration["engine"]["tile-size"]
hex_color = ConfigurationManager.configuration["color"]["languid-lavender"]
hex_color = ConfigurationManager.configuration["color"]["border"] # TODO Should abstract color call?
base_color = pygame.Color(self.color) # TODO Should abstract color call?
base_color = pygame.Color(self.color)
border_color = pygame.Color(hex_color)
for sub_points in self.points: