sep-pm-platformer/project/level/elements/ButtonInputLevelElement.py

21 lines
778 B
Python
Raw Normal View History

2023-03-27 11:46:03 +02:00
from level.Level import Level
from level.elements.InputLevelElement import InputLevelElement
from physics.SpriteManager import SpriteManager
from physics.TickData import TickData
from sprite.SpritesheetManager import SpritesheetManager
class ButtonInputLevelElement(InputLevelElement):
def load(self, sprite_manager: SpriteManager, spritesheet_manager: SpritesheetManager, level: Level):
name = self.tile['name']
position = self.tile['position']
self.spritesheet = spritesheet_manager.get_sheet('pressureplate')
self.set_animation_state('on' if self.emitter_state else 'off')
self.position_scale.position = position
def tick(self, tick_data: TickData):
collisions = self.get_collides_with()
print(collisions)