2023-03-27 18:52:49 +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 BouncingBallLevelElement(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:52:49 +02:00
|
|
|
|
|
|
|
self.bounce_factor = -1
|
|
|
|
|
|
|
|
def load(self, sprite_manager: SpriteManager, spritesheet_manager: SpritesheetManager, level: Level):
|
|
|
|
self.spritesheet = spritesheet_manager.get_sheet('debug_1')
|
|
|
|
self.set_animation_state('1')
|
|
|
|
self.position_scale.position = self.tile['position']
|
|
|
|
self.position_scale.scale = (0.5, 0.5)
|