feat: add new dialogue boxes; add another green ninja npc; add an array of dialogues variations;
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
extends StaticBody2D
|
||||
|
||||
@export var dialogue_lines: Array[String] = ["Hello!", "Good day to you!", "Welcome!"]
|
||||
var can_interact: bool = false
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
if Input.is_action_just_pressed("Interact") and can_interact:
|
||||
$CanvasLayer/DialogLabel.text = dialogue_lines[randi_range(0, 2)]
|
||||
if $CanvasLayer.visible == false:
|
||||
$CanvasLayer.visible = true
|
||||
get_tree().paused = true
|
||||
else:
|
||||
$CanvasLayer.visible = false
|
||||
get_tree().paused = false
|
||||
|
||||
Reference in New Issue
Block a user