Connected the dialog box to the NPC

This commit is contained in:
2026-03-11 16:54:12 +11:00
parent 21141376d2
commit 94b810e4f1
3 changed files with 16 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
class_name ArrowGirl extends Area2D
@onready var _dialogController = $/root/Scene/DialogController
@onready var _sprite = $AnimatedSprite2D
#boilerplate
@@ -12,3 +13,11 @@ func _on_animation_finished() -> void:
_sprite.play("idle_glance", 2)
else:
_sprite.play("idle", 2)
func _on_body_entered(body) -> void:
if body is BoxBoy:
_dialogController.set_dialog("Hello.", 0.2)
func _on_body_exited(body) -> void:
if body is BoxBoy:
_dialogController.set_dialog("")