Basic dialog system working

This commit is contained in:
2026-03-16 08:57:53 +11:00
parent 336dd59dbb
commit b433c31261
7 changed files with 45 additions and 26 deletions

View File

@@ -1,8 +1,7 @@
class_name ArrowGirl extends Area2D
@onready var _sprite = $AnimatedSprite2D
var dialog_text = preload("res://DialogDebug_1.tres")
var dialog_counter: int = 0
var dialog_text: DialogText = preload("res://DialogDebug_1.tres")
#boilerplate
func _ready():
@@ -17,9 +16,4 @@ func _on_animation_finished() -> void:
func _on_body_entered(body) -> void:
if body is BoxBoy:
%DialogController.set_dialog(dialog_text.get_line_raw(dialog_counter), 0.2)
dialog_counter += 1
func _on_body_exited(body) -> void:
if body is BoxBoy:
%DialogController.set_dialog("")
%DialogController.set_dialog_text(dialog_text, 0.2)