2023-03-27 18:37:30 +02:00
|
|
|
from level.Level import Level
|
|
|
|
from level.elements.dynamic.PushableLevelElement import PushableLevelElement
|
|
|
|
from physics.SpriteManager import SpriteManager
|
|
|
|
from sprite.SpritesheetManager import SpritesheetManager
|
|
|
|
|
|
|
|
|
|
|
|
class PushableBoxLevelElement(PushableLevelElement):
|
2023-03-29 15:40:15 +02:00
|
|
|
def __init__(self, tile: dict, loaded_level, level_screen_manager: 'LevelScreenManager'):
|
|
|
|
super().__init__(tile, loaded_level, level_screen_manager)
|
2023-03-27 18:37:30 +02:00
|
|
|
|
|
|
|
if 'size' in self.tile:
|
|
|
|
self.position_scale.scale = (float(self.tile['size']),
|
|
|
|
float(self.tile['size']))
|
|
|
|
|
|
|
|
def load(self, sprite_manager: SpriteManager, spritesheet_manager: SpritesheetManager, level: Level):
|
|
|
|
self.spritesheet = spritesheet_manager.get_sheet('movable_box')
|
|
|
|
self.set_animation_state('1')
|
|
|
|
self.position_scale.position = self.tile['position']
|