extends Node2D

export var delay = 0.9
var is_on_fall = false

func _on_body_entered(body):
	if is_on_fall:
		return
	is_on_fall = true
	yield(get_tree().create_timer(delay),"timeout")
	$Area2D.monitoring = false
	$AnimationPlayer.play("fall")
	Audio.play_sound("creak", false)
	
func _ready():
	$Area2D.connect("body_entered", self,"_on_body_entered")

