19 lines
807 B
Python
19 lines
807 B
Python
|
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):
|
||
|
def __init__(self, tile: dict, loaded_level):
|
||
|
super().__init__(tile, loaded_level)
|
||
|
|
||
|
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']
|