Connected the dialog box to the NPC
This commit is contained in:
@@ -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("")
|
||||
|
||||
Reference in New Issue
Block a user