feat: add next piece logic

This commit is contained in:
2021-06-14 14:38:25 -04:00
parent 0e96b9ec47
commit 2134455b24
2 changed files with 13 additions and 6 deletions

View File

@@ -147,12 +147,13 @@ class Piece(Entity):
self.gravity_time = gravity_time - (game.get_level() * gravity_increase)
self.set_time = set_time
def draw(self, surface: pygame.Surface, well: Well, stack: "Stack") -> None:
def draw(self, surface: pygame.Surface, well: Well = None, stack: "Stack" = None) -> None:
tile_size = ConfigurationManager.get("engine", "tile-size")
# ghost piece
for square in self._get_ghost_piece_points(well, stack):
pygame.draw.polygon(surface, pygame.Color("#FFFFFF"), square, max(tile_size // 6, 1)) # TODO add white to the yaml
if well and stack:
for square in self._get_ghost_piece_points(well, stack):
pygame.draw.polygon(surface, pygame.Color("#FFFFFF"), square, max(tile_size // 6, 1)) # TODO add white to the yaml
super().draw(surface)