2026-10-23 14:14:13 +00:00
|
|
|
import pygame
|
|
|
|
|
|
|
|
|
|
from scripts.constants import *
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Wall:
|
2026-10-23 15:43:02 +00:00
|
|
|
def __init__(self, game, x: float, y: float, cols: int, rows: int):
|
2026-10-23 14:14:13 +00:00
|
|
|
self.game = game
|
|
|
|
|
self.x = x
|
|
|
|
|
self.y = y
|
2026-10-23 15:43:02 +00:00
|
|
|
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]] = []
|
2026-10-23 14:14:13 +00:00
|
|
|
|
|
|
|
|
|
2026-10-23 15:43:02 +00:00
|
|
|
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))
|
2026-10-23 14:14:13 +00:00
|
|
|
|
2026-10-23 15:43:02 +00:00
|
|
|
self.grid.append(current_row)
|
2026-10-23 14:14:13 +00:00
|
|
|
|
|
|
|
|
def update(self):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def render(self, surface: pygame.Surface):
|
2026-10-23 15:43:02 +00:00
|
|
|
pass
|
|
|
|
|
|
2026-10-23 14:14:13 +00:00
|
|
|
def get_rect(self) -> pygame.Rect:
|
2026-10-23 15:43:02 +00:00
|
|
|
return self.rect
|