import pygame from scripts.constants import * class Wall: def __init__(self, game, x: float, y: float, cols: int, rows: int): self.game = game self.x = x self.y = y self.cols = cols self.rows = rows self.rect = pygame.Rect(x, y, cols*TILE_SIZE, rows*TILE_SIZE) self.drawed_rect = None self.grid: list[list[pygame.Rect]] = [] for row in range(self.rows): # rows current_row = [] for col in range(self.cols): # cols current_row.append(pygame.Rect(col*TILE_SIZE, row*TILE_SIZE, TILE_SIZE, TILE_SIZE)) self.grid.append(current_row) def update(self): pass def render(self, surface: pygame.Surface): for row in self.grid: for wall_rect in row: surface.blit(self.game.assets["wall"], wall_rect) def get_rect(self) -> pygame.Rect: return self.rect