sep-pm-platformer/project/level/elements/dynamic/PushableBoxLevelElement.py

19 lines
873 B
Python
Raw Permalink Normal View History

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, level_screen_manager: 'LevelScreenManager'):
super().__init__(tile, loaded_level, level_screen_manager)
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']