feat: add collision logic between entities

This commit is contained in:
2021-06-08 14:02:23 -04:00
parent 673c4774f2
commit 776170fb9b
5 changed files with 45 additions and 42 deletions

View File

@@ -9,15 +9,8 @@ class Well(Entity):
WIDTH = 10 # standard tetris well width, should not be changed
HEIGHT = 20 # standard tetris well height, should not be changed
def __init__(self, position: Tuple):
self.points = self.__get_points(position)
def draw(self, surface: pygame.Surface) -> None:
well_color_hex = ConfigurationManager.configuration["color"]["border"] # TODO Should abstract out color call?
well_color = pygame.Color(well_color_hex)
for sub_points in self.points:
pygame.draw.polygon(surface, well_color, sub_points, 0)
def __init__(self, position: Tuple, color):
super().__init__(self.__get_points(position), color)
def __get_points(self, position: Tuple) -> List:
tile_size = ConfigurationManager.configuration["engine"]["tile-size"]