goodnight_jellybean/godot/assets/audio/voice_lines/LineReader.gd

40 lines
605 B
GDScript

extends Node
var voice_script = [
["the_long", "book"],
["the_tall", "book"],
["the_door"],
["the_clock"],
["under_the_bed"],
["frog"],
["squirrel"],
["the_attic"],
["the_fridge"],
["the_tall", "book"],
["under_the_bed"],
["the_long", "book"],
["behind_the_bookshelf"],
]
export var impatience: float = 5.0
func read_line(line):
pass
var loop = null
func start():
if loop != null:
return
loop = script_loop()
func script_loop():
for line in voice_script:
read_line(line)
while not yield():
read_line(line)
func _on_ImpatienceTimer_timeout():
script_loop().resume(false)