forked from harper/spooktober-vnj
basic dialogue progression
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
extends Resource
|
||||
class_name Choice
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
uid://d2d5w1vmd71js
|
||||
@@ -0,0 +1,6 @@
|
||||
extends Resource
|
||||
class_name Dialogue
|
||||
|
||||
@export var character: Character
|
||||
@export_multiline() var dialogue: String
|
||||
@export var choice: Dictionary[Choice, Dialogue]
|
||||
@@ -0,0 +1 @@
|
||||
uid://dw5jr50hsls5n
|
||||
@@ -0,0 +1,7 @@
|
||||
extends Resource
|
||||
class_name DialogueScene
|
||||
|
||||
@export var dialogue: Array[Dialogue]
|
||||
|
||||
func get_scene() -> Array[Dialogue]:
|
||||
return self.dialogue
|
||||
@@ -0,0 +1 @@
|
||||
uid://cu54e7uh65lq0
|
||||
@@ -0,0 +1,18 @@
|
||||
extends Node
|
||||
class_name DialogueEncounter
|
||||
|
||||
var dialogue: DialogueScene
|
||||
signal step
|
||||
|
||||
func _init(path: Resource) -> void:
|
||||
self.dialogue = path
|
||||
await Start()
|
||||
|
||||
func _input(_event: InputEvent) -> void:
|
||||
if Input.is_action_just_pressed("ui_accept"):
|
||||
step.emit()
|
||||
|
||||
func Start():
|
||||
for i in self.dialogue.get_scene():
|
||||
print(i.dialogue)
|
||||
await step
|
||||
@@ -0,0 +1 @@
|
||||
uid://bglbul22528pf
|
||||
Reference in New Issue
Block a user