extends AudioStreamPlayer2D

var immune = 0.3
@onready var player = $"../../"

func _ready():
	#pitch_scale = player.velocity.y / player.JUMP_VELOCITY
	play()

func _process(delta):
	immune -= delta
	if Input.is_action_pressed("jump") or immune > 0:
		pitch_scale += delta * (pitch_scale)
		volume_db -= delta * 15 * (1 - immune)
	
	if player.is_on_floor():
		queue_free()


func _on_finished():
	queue_free()
