feat(game): positions next figure images

This commit is contained in:
Kristofers Solo 2024-01-04 05:26:29 +02:00
parent e5475e6e5f
commit 3b4865b8a1

View File

@ -13,6 +13,8 @@ class Preview:
)
self.dispaly_surface = pygame.display.get_surface()
self.increment_height = self.surface.get_height() / 3
def run(self, next_figures: list[Figure]) -> None:
self.dispaly_surface.blit(self.surface, self.rect)
self.draw(next_figures)
@ -32,6 +34,9 @@ class Preview:
)
def _draw_figures(self, figures: list[Figure]) -> None:
for figure in figures:
for idx, figure in enumerate(figures):
figure_surface = figure.value.image
self.surface.blit(figure_surface, (0, 0))
x = self.surface.get_width() / 2
y = self.increment_height / 2 + idx * self.increment_height
rect = figure_surface.get_rect(center=(x, y))
self.surface.blit(figure_surface, rect)