extends CharacterBody2D func _ready(): if OS.has_feature("mobile"): scale = Vector2(1.5, 1.5) var tween = create_tween() tween.set_loops() tween.tween_method(func(value): $Line2D.set_point_position(2, Vector2(value, $Line2D.points[2].y)) , -2, 2, randf_range(0.5, 1.5)).set_delay(0.01) tween.tween_method(func(value): $Line2D.set_point_position(2, Vector2(value, $Line2D.points[2].y)) , 2, -2, randf_range(0.5, 1.5)).set_delay(0.01) tween.tween_method(func(value): $Line2D.set_point_position(3, Vector2(value, $Line2D.points[3].y)) , -1, 1, randf_range(0.5, 1.5)).set_delay(0.01) tween.tween_method(func(value): $Line2D.set_point_position(3, Vector2(value, $Line2D.points[3].y)) , 1, -1, randf_range(0.5, 1.5)).set_delay(0.01) func _process(_delta: float) -> void: move_and_slide() var collision := get_last_slide_collision() if collision: velocity = velocity.bounce(collision.get_normal()) func _on_area_2d_area_entered(area: Area2D) -> void: if area.is_in_group("arrow"): Game.score += 1 SoundManager.balloon.get_children().pick_random().play() queue_free() func _on_visible_on_screen_notifier_2d_screen_exited() -> void: queue_free()