def __init__(self, surface: Surface, weight: float, max_health: float, attack_cooldown: float, damage_reduction: float = 1): RigidPhysicsAwareGameObject.__init__(self, surface, weight) LivingEntity.__init__(self, max_health, damage_reduction) self._attack_cooldown: float = attack_cooldown self.__cooldown_expire: float = 0 self._target: GameObject = None self._direction = 1
def __init__(self, weight: float = .5): sprites = ResourceManagement.get_player_sprites() first_sprite = next(iter(sprites.values()))[0] RigidPhysicsAwareGameObject.__init__(self, first_sprite, weight) LivingEntity.__init__(self, PlayerSettings.HEALTH_MAX, invincibility_duration=1) AnimatedSprite.__init__(self, sprites, 3, PlayerState.IDLE) self.ability_tornado_jump = TornadoJumpAbility(1) self.ability_gust = GustAbility(0) self.ability_slam = SlamAbility(0) self.mana: float = PlayerSettings.MANA_MAX self._last_direction = 1
def __init__(self, on_enter: [Callable[[], None]] = None, on_stay_inside: [Callable[[], None]] = None, on_exit: [Callable[[], None]] = None): sprites = ResourceManagement.get_environment_button_sprites() first_sprite = next(iter(sprites.values()))[0] RigidPhysicsAwareGameObject.__init__(self, first_sprite, 0) AnimatedSprite.__init__(self, sprites, 1, ButtonState.OFF) self.on_enter = on_enter if on_enter is not None else [] self.on_enter.append(self.__hide) self.during_activation = on_stay_inside if on_stay_inside is not None else [] self.on_exit = on_exit if on_exit is not None else [] self.on_exit.append(self.__show) self.was_pressed = False self.is_pressed = False
def __init__(self, size: (int, int), direction: Vector2, force: float): surface = Surface(size) RigidPhysicsAwareGameObject.__init__(self, surface, 0) AnimatedSprite.__init__( self, ResourceManagement.get_environment_wind_stream_sprites(size), 2, WindDirection.UP) self._direction = direction.normalize() self._force = force if abs(direction.x) > abs(direction.y): if direction.x > 0: self._state = WindDirection.RIGHT else: self._state = WindDirection.LEFT else: if direction.y > 0: self._state = WindDirection.DOWN else: self._state = WindDirection.UP
def __init__(self, size: (int, int), level_name: str): surface: Surface = Surface(size, flags=pygame.SRCALPHA) surface.fill((0, 0, 0, 0)) RigidPhysicsAwareGameObject.__init__(self, surface, 0) self._level_name = level_name
def __init__(self, surface: Surface, weight: float, force_threshold: float): RigidPhysicsAwareGameObject.__init__(self, surface, weight) self.force_threshold = force_threshold
def __init__(self): sprite: Surface = ResourceManagement.get_image('orb_slam.png') RigidPhysicsAwareGameObject.__init__(self, sprite, 0)
def __init__(self, surface: Surface): RigidPhysicsAwareGameObject.__init__(self, surface, 0) self.resistance_amount = 0