def activate(self, player: pygame.sprite.Sprite): if not self.activated: player.enable_gravity(False) player.set_flying_object(self) self.activated = True
def on_delete(self, player: pygame.sprite.Sprite): if self.activated: self.sound.stop() player.enable_gravity(True) player.set_flying_object()