Basic dialog system working
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user