extends Node3D

@onready var anim_player : AnimationPlayer = $AnimationPlayer

func _ready() -> void:
	anim_player.play("default")


func _on_timer_timeout() -> void:
	print("Done")
	queue_free()

func proximal_shake(distance : float) -> void:
	print(Input.get_connected_joypads())
	if !Game.player:
		return
	var d = global_position.distance_squared_to(Game.player.global_position)
	var d_sq = distance * distance
	if d <= d_sq:
		var str : float = (d_sq - d) / d_sq
		var l_val : float = lerp(0.0, 1.0, str)
		Input.start_joy_vibration(0, l_val,l_val,lerp(0.5, 1.0, str))
		Game.player.camera.add_trauma(l_val)
		
