extends Node2D

@export var show_range : int = 50

func _process(_delta: float) -> void:
	var player = get_tree().get_first_node_in_group("player")
	if player:
		if player.global_position.distance_to(global_position) < show_range:
			show_ins()
		else:
			hide_ins()

func show_ins():
	var tween = create_tween()
	tween.tween_property(self, "modulate:a", 1, 0.2)
	tween.parallel().tween_property(self, "position:y", -23, 0.2)

func hide_ins():
	var tween = create_tween()
	tween.tween_property(self, "modulate:a", 0, 0.2)
	tween.parallel().tween_property(self, "position:y", -16, 0.2)
