#@tool
#@icon(icon_path: String)
class_name Musician
extends AnimatedSprite2D
## Documentation comments

#signal
#enum
#const

@export_group("Input Textures")
@export var solid_texture: Texture2D
@export var outline_texture: Texture2D

var is_active: bool = false

@onready var audio: AudioStreamPlayer2D = %Audio
@onready var light: PointLight2D = %Light
@onready var occluder: LightOccluder2D = %Occluder
@onready var input_prompt: Sprite2D = %InputPrompt

## OVERRIDES

func _ready() -> void:
	light.visible = false
	audio.connect("finished", enter_exit)
	input_prompt.texture = outline_texture
	audio.volume_db = -100.0
	is_active = true


func _process(_delta: float) -> void:
	pass

func _physics_process(_delta: float) -> void:
	pass

## CORE
func enter_exit() -> void:
	if is_active:
		play("idle")
		#audio.stop()
		audio.volume_db = -100.0
		light.visible = false
		is_active = false
		input_prompt.texture = outline_texture
	else:
		play("default")
		#audio.play()
		audio.volume_db = 0.0
		light.visible = true
		is_active = true
		input_prompt.texture = solid_texture

## PRIVATE/HELPER

## RECEIVERS

## SETTERS/GETTERS
