Fertige Wand Renderung

This commit is contained in:
Benjamin 2026-10-23 17:58:20 +02:00
parent 64cb1fa862
commit 02622ce4b8
2 changed files with 3 additions and 2 deletions

View file

@ -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)
],
)

View file

@ -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