From 02622ce4b8648c667c2fae457033c998e5d8ef1c Mon Sep 17 00:00:00 2001 From: Benjamin Date: Fri, 23 Oct 2026 17:58:20 +0200 Subject: [PATCH] Fertige Wand Renderung --- game.py | 2 +- scripts/wall.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/game.py b/game.py index 7a8dc5c..293195d 100644 --- a/game.py +++ b/game.py @@ -46,7 +46,7 @@ class Game: Wall( self, TILE_SIZE, SCREEN_HEIGHT - TILE_SIZE, SCREEN_WIDTH//TILE_SIZE, 1 ), - Wall(self, SCREEN_WIDTH - TILE_SIZE, 0, SCREEN_WIDTH//TILE_SIZE, SCREEN_HEIGHT//TILE_SIZE), + Wall(self, SCREEN_WIDTH - TILE_SIZE, 0, 1, SCREEN_HEIGHT//TILE_SIZE), Wall(self, 500, 500, 2, 2) ], ) diff --git a/scripts/wall.py b/scripts/wall.py index f5a022e..78d5eaa 100644 --- a/scripts/wall.py +++ b/scripts/wall.py @@ -18,7 +18,7 @@ class Wall: 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)) + current_row.append(pygame.Rect(self.x+col*TILE_SIZE, self.y+row*TILE_SIZE, col*TILE_SIZE, row*TILE_SIZE)) self.grid.append(current_row) @@ -29,6 +29,7 @@ class Wall: 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