21 lines
723 B
Python
21 lines
723 B
Python
from level.Level import Level
|
|
from level.elements.static.StaticLevelElement import StaticLevelElement
|
|
from physics.SpriteManager import SpriteManager
|
|
from sprite.SpritesheetManager import SpritesheetManager
|
|
|
|
BLOCK_TYPES = {
|
|
'A': 'staubsauger'
|
|
}
|
|
|
|
class VacuumCleanerElement(StaticLevelElement):
|
|
|
|
def __init__(self, tile: dict, loaded_level):
|
|
super().__init__(tile, loaded_level)
|
|
|
|
def load(self, sprite_manager: SpriteManager, spritesheet_manager: SpritesheetManager, level: Level):
|
|
block_type = BLOCK_TYPES[self.tile['name']]
|
|
|
|
self.spritesheet = spritesheet_manager.get_sheet(block_type)
|
|
|
|
self.set_animation_state('on')
|
|
self.position_scale.position = self.tile['position'] |