school-horror-game/scripts/level.py

32 lines
759 B
Python
Raw Permalink Normal View History

import pygame
from scripts.constants import *
from scripts.item import Item
from scripts.wall import Wall
class Level:
def __init__(self, game, items: list[Item], walls: list[Wall]):
self.game = game
# Items
self.items = items
# Level
self.walls = walls
2026-11-11 16:46:48 +00:00
def update(self):
for wall in self.walls:
wall.update()
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:
wall.render(surface)