2026-10-16 16:31:55 +00:00
|
|
|
import pygame
|
|
|
|
|
|
|
|
|
|
from scripts.constants import *
|
|
|
|
|
from scripts.item import Item
|
2026-10-23 14:14:13 +00:00
|
|
|
from scripts.wall import Wall
|
2026-10-16 16:31:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class Level:
|
2026-10-23 14:14:13 +00:00
|
|
|
def __init__(self, game, items: list[Item], walls: list[Wall]):
|
2026-10-16 16:31:55 +00:00
|
|
|
self.game = game
|
|
|
|
|
|
|
|
|
|
# Items
|
|
|
|
|
self.items = items
|
|
|
|
|
|
|
|
|
|
# Level
|
|
|
|
|
self.walls = walls
|
|
|
|
|
|
|
|
|
|
def render(self, surface: pygame.Surface):
|
|
|
|
|
for y in range(ROWS):
|
|
|
|
|
for x in range(COLS):
|
|
|
|
|
surface.blit(
|
|
|
|
|
self.game.assets["floor_01"],
|
|
|
|
|
pygame.Rect(x * 64, y * 64, TILE_SIZE, TILE_SIZE),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Wände
|
|
|
|
|
for wall in self.walls:
|
2026-10-23 14:14:13 +00:00
|
|
|
wall.render(surface)
|
|
|
|
|
|