Added structure for Level loading

main
Yan Wittmann 2023-03-26 11:21:22 +02:00
parent f1709229c5
commit 7d3dd16fe5
3 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,5 @@
from level.elements.LevelElement import LevelElement
class BlockElement(LevelElement):
pass

View File

@ -0,0 +1,2 @@
class LevelElement:
pass

View File

@ -0,0 +1,23 @@
from level.Level import Level
from physics.SpriteManager import SpriteManager, DrawLayers
from sprite.SpritesheetManager import SpritesheetManager
from sprite.StaticSprite import StaticSprite
BLOCK_SIZE = (16, 16)
class LoadedLevel:
def __init__(self, sprite_manager: SpriteManager, spritesheet_manager: SpritesheetManager):
self.sprite_manager = sprite_manager
self.spritesheet_manager = spritesheet_manager
def load_level(self, level: Level):
for row in level.tiles:
for tile in row:
pass
sprite = StaticSprite(self.spritesheet_manager.get_sheet('test_1'))
sprite.position_scale.position = (1, 1)
sprite.set_animation_state('idle')
self.sprite_manager.add_ui_element(DrawLayers.OBJECTS, None)